JQuery check server updates in setInterval function - what else can I use?

I want to create a code that will check if there are any new messages about the music and show their number. I know this is simple - just make ajax calls in a function setInterval:

$(document).ready(function () {

    setInterval(function () {
        //create an ajax call
    }, 30000);

});

but this is not the main thing - I can not find any information about other approaches. Is this the only way to achieve this by installing a function setIntervalto check for updates?

Edit

Ok, I found http://socket.io/ , maybe this is what I'm looking for

+4
source share
2 answers

setTimeout , , - , , , 30 . ( , ), ( , ).

; Google " ".

+4

All Articles