1

I am wondering if this is possible to push a message from server to web browser?? Like you want to alert user or any message that you want to send to specific user... An example is as chat invitation is sent from chat operator to site visitor...

Is it possible?? i prefer to use PHP, Javascript

I don't want to use AJAX calls to PULL, i want to PUSH.

Looking forward.

Alyas
  • 11
  • 1
  • 2
  • 1
    It's certainly possible. but annoying. – bcosca Nov 23 '10 at 11:49
  • please refer this thread of Stackoverflow http://stackoverflow.com/questions/1320542/simple-comet-example-using-php-and-jquery – Romani Nov 23 '10 at 12:03
  • If you are familiar with Google Web Toolkit, you should look at this link: [http://code.google.com/p/google-web-toolkit-incubator/wiki/ServerPushFAQ](http://code.google.com/p/google-web-toolkit-incubator/wiki/ServerPushFAQ) – Fabrizio D'Ammassa Nov 23 '10 at 11:50

3 Answers3

3

You can't actually push yet. You can use Comet techniques, including long-polling, but you can't actually push yet. Someday you'll be able to use web sockets.

T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875
2

I think the way to do this is just to use AJAX to pull every so often.

Joseph
  • 12,678
  • 19
  • 76
  • 115
1

You would have to be running some sort of program on the client that you can push stuff to.

Like

  • an IM client or similar program
  • a browser window with a page that does frequent Ajax checks (probably the most easy way to go)
  • a browser window with a page that has a COMET connection open.
Pekka
  • 442,112
  • 142
  • 972
  • 1,088