Skip to content

Instantly share code, notes, and snippets.

@derencius
Created August 18, 2010 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derencius/533216 to your computer and use it in GitHub Desktop.
Save derencius/533216 to your computer and use it in GitHub Desktop.
var to;
$(function() {
// initialize timer to update div every 5 seconds
to = setTimeout(message_load(), 5000);
});
function message_load() {
$.get("/messages",function(data) {
if (data.VERIFICA_SE_TEM_CONTEUDO) {
alert(data.conteudo);
}
to = setTimeout(message_load, 5000);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment