Change web page content in real time without ajax

I realized at one point with firebug at stackoverflow.com, when someone accepted your answer, suddenly your points were increased without any Ajax hit by any method. Amazing how is this possible?

I ask for advice so that I can try to implement this technique in my future projects. Thanks in advance.

+4
source share
3 answers

Make sure you look at the net option. There are two ways that I can tell.

  • Web sockets
  • iFrame

Please see http://www.html5rocks.com/en/features/connectivity and http://html5demos.com/web-socket

But will work in limited browsers

Using an iFrame with a simple receive request, no ajax call will be made, but you can see its firebug net. This is what Facebook uses and the entire browser is compatible.

+2
source

It uses WebSockets instead Ajax XMLHttpRequest in modern browsers. More information on the implementation can be found at meta.stackoverflow.com .

The main advantage of WebSockets is that the server can send an update to the browser the moment you receive the message . Other methods, such as XHR and hidden frames, require the browser to periodically poll the server in order to get an updated vote count.

+2
source

you can use the send image button and send to a small iframe that displays the number.

otherwise, you will still mess with the hidden iframe and send or receive messages in the hidden iframe.

If you really need less javascript solution, the form sends a hidden / small iframe.

+1
source

All Articles