I'm trying to create a basic app which uses long polling.
So, my site makes an Ajax request to my server. My server script loops (10 seconds long) and checks if there's new data. If there's new data availible, it returns a JSON string and the new data is immidiately displayed on the webpage.
But the problem is, when the Ajax request is made to server and no data comes in for 10 seconds, then that means it waits 10 seconds. In those 10 seconds i can't click on any other links in my webpage. It sits out those 10 seconds and navigates away after that.
I'm sure there's a workaround for this. Because realtime websites like auction sites and things like that are using the same technique. And i can navigate away any time that i want.
So basically my question is, if anyone here knows how to handle this? So that my page isn't 'hanging' while its waiting for data..