Log in

View Full Version : Resolved jquery ajax for live chat



keyboard
05-23-2012, 02:05 AM
Hello everyone,

EDIT -

I would like some jQuery code that connects to a page (ajax) {and sends some info}, then returns whatever is echoed and assigns it to the innerHTML of the div with the id usermsg.
I need it to automatically do this every 2.5 seconds.

Thanks, Keyboard1333

keyboard
05-23-2012, 09:22 AM
Ah ha!

Fixed it -



$(document).ready(function() {
$("#chatBox").load("update.php");
var refreshId = setInterval(function() {
$("#chatBox").load('update.php');
}, 1000);
$.ajaxSetup({ cache: false });
});