Get Latest Updated Data using SSE(Server-Sent-Events) Automatically

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

index.php_SSE

so here i’m using SSE and in EventSource i’m passing viewpost.php file, which fetch latest record from table.

viewpost.php

viewpost.php_SSE

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. .. 🙂

Auto Complete Form Field

hello guys,

i found easy way to create auto-complete field. actually this is HTML5 feature,  you can use list attribute in your input type which is associated with datalist that renders autocomplete while people are typing in that field.

so here is simple code!

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h2>HTML5 Form Input Autocomplete datalist</h2>
Search State:
<input type=”text” name=”srch” id=”srch” list=”datalist1″ />
<datalist id=”datalist1″>
<option value=”gujarat”>
<option value=”karnataka”>
<option value=”panjab”>
<option value=”rajasthan”>
</datalist>
</body>
</html>

Done 🙂