hii guys,
This is very interesting topic which i gonna share with you people. So many times i think about how facebook/Twitter updates, stock price updates, news feeds, sport results are working?
finally i found easy and simple way to do same thing. so i just developed simple application which demonstrate usage of SSE (Sever-Sent-Events).
so i developed Latest Job Post Application, which give you latest job posted by any employee on webpage automatically.
let’s go for coding
index.html
so here i’m using SSE and in EventSource i’m passing viewpost.php file, which fetch latest record from table.
viewpost.php
As a output in {topjob} div, always latest job will be printed without refreshing page.
About SSE:
A server-sent event is when a web page automatically gets updates from a server.
This was also possible before, but the web page would have to ask if any updates were available. With server-sent events, the updates come automatically.
Examples: Facebook/Twitter updates, stock price updates, news feeds, sport results, etc.
Disadvantage:
IE does not support it .. 😦
Done!
Hope you gonna like Dis. .. 🙂