How to Load and Refresh Div every x Seconds with jQuery and Ajax

As of these days most social networking sites are using this event to load most recent posts every second without refreshing page, stream and tweets like Facebook, Google+ and Twitter, it loads in the top part of the page and I’d try developed one with jQuery and Ajax to mimic this functionality, it’s really simple and easy to use.

Okay let’s start.


This contains html and javascript code. load('load_post.php');


This contains php script to get data from the database.

This is very helpful if you want to get and load data from database in every x seconds without refreshing your page.

by Ryan Sutana

  • Aw, this was a really top quality post. In theory I’d like to write like this too – taking time and actual effort to make a fantastic article… but what can I say… I procrastinate alot and never seem to get some thing performed.

  • Guest

    sample comment

  • hey