我正在聊天,现在我希望 messages.php
一直重新加载,但不是您可以输入消息的地方。
我用这个:
<script type="text/javascript">
$(function()
{
setinterval(function){}
$("#reload").load("messages.php");,1000);
});
</script>
<div id="reload"></div>
<html>
<form action="sendmessages.php" method="get">
<textarea name="bericht" cols="60" rows="10"></textarea><br>
<input value="verstuur" type="submit">
</form>
</html>
最佳答案
代码
setinterval(function){}
$("#reload").load("messages.php");,1000);
应该是:
setInterval(function(){
$("#reload").load("messages.php");
},1000);
关于javascript - 设置间隔不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21762078/