function chat_refresh() {
var refresh = 1;
var ajax = new Ajax();
ajax.responseType = Ajax.FBML;
ajax.ondone = function(data) {
document.getElementById('chat').setInnerFBML(data);
}
ajax.requireLogin = 1;
var params = {'refresh' : refresh};
ajax.post("chat.php?refresh", params);
setTimeout(chat_refresh, 1000*10);
}
lets say in chat.php?refresh
you print "hello world";
then "hello world" will get printed in between
before:
after:
hello world
tags in the HTML page.note:
setTimeout(chat_refresh, 1000*10);
is a function that will automatically call chat_refresh every 10 seconds.
No comments:
Post a Comment