I'm trying to write a chat client using javascript, but I'm being hindered by only being able to communicate with the server using XMLHttpRequest which as far as I can tell is completely unsuitable, as many have told me.
I've looked for other networking functions but haven't found any and been told that there aren't any. It's almost enough to make me stop looking, except Gmail seems to be doing it somehow. It makes no requests for several minutes, then as soon as I send an email to myself, my inbox in another window sends a POST request and receives the email. Since it hasn't sent any http requests to the server for minutes (I checked using firebug) it can't have been talking to the server that way, so how does it know when it has an email to receive?