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. .. 🙂
I think EventSource is NOT supported in IE browser, and is an HTML5 only feature. Nice feature though.
ya, its not supported in IE. but its supported in other browser.!
hello
heyy
This one row. order by id desc limit 5
+ while { 5 row } not working ?
Hi,
what you show above is exactly what I am looking for: Always getting the latest datarow of a MYSQL database table.
Unfortunately, I was not able to get your example up and running even though I copied it letter by letter.
Have you ever executed your code?
I mean, reacting to, for instance, a change in server time works as expected (see here: http://www.w3schools.com/html/html5_serversentevents.asp) but yours just won’t fire.
Any feedback is appreciated!
Mike