The very basic idea behind ajax, to put it as layman as possible, is to be able to yet issue another http request, without reloading the whole page. Using a firebug console to peek into whats going on under the hood, we can see what our page tried to submit to this request, and view the relying responses. My questions therefore are:
How can we tell if the logs on the console did originated on our page? Or does it log anything that is running asynchronously?
Is it possible to setup a web server to, say, respond to all active connections and throw them html/json data without them requesting it? Rephrase, if someone requested the homepage, and while they are viewing its contents, could the server tell who are currently connected and send them responses, without the users initiating ajax?
The reason for this came from the topic of how some bidding sites work. Lets use beezid. com as an example.
Hey Mittineague, good to know your still active here!
My brain still isnt in the zone, but as far as I can tell, your also not sure about the problem. Let me bring up a similar scenario it it would help.
Lets say you requested a page, sort of like a chat application. You stare onto that page long after it has completed loading. After a few seconds, suddenly a message pops out.
My question now is, how did this happen? I assume its not reliable to regularly send ajax request to look for new chat messages. I was thinking if there is any way, that upon a specific event, I could ask my server to send another http response to all currently active connections, without the browser requesting them. Therefore, new chat messages will only be receive if there is any new ones, eliminating unnecessary ajax request from the browser.
Hmmm, I understand. Actually, I have the same conclusion. My purpose in asking really is that there may be similar new technologies I’m not aware of that might be useful.
What your implying my a boolean response, is that the chatroom setup will be using some sort of storage, a database perhaps, so we have a place to check for available responses. This is the traditional way I think, but there’s something I’ve encountered over the last couple of days which might be useful.
This NodeJS could be used to listen to events on the server side, such that it could react to connection events. Since it can detect connections, its easy to send a reply to all active connections, but thats where I have a problem. How can a server send a text/html response to a browser without the browser initially requesting? Do you have any experience with this sort of scenario?