Hello,
I am working on a chat application in jQuery and I have used the function setInterval(), however, it doesn't seem to refresh the div element.. Or load it for that matter.. Here is the code:
<!DOCTYPE html>
<html>
<head>
<style>
#shoutbox
{
width: 400px;
height: 400px;
border-style:solid;
border-width:5px;
}
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<div id="shoutbox">
</div>
<script>
$(document).ready(function()
{
function LoadMessages() {
$('#shoutbox').load('chat.php');
}
setInterval("LoadMessages()", 10000);
});
</script>
<form id="chatForm">
<input type="text" id="chatText" />
<input type="submit" />
</form>
</body>
</html>
Hope someone cal help, thanks :)