Samir Ghobril
Samir Ghobril

Reputation: 5229

How to auto-refresh news feed

Hey guys, I just created a news feed and I was wondering if there was a way to auto-refresh the feed with javascript or php, sort of like facebook, without refreshing the whole page. Thanks in advance.

Upvotes: 0

Views: 2332

Answers (2)

UserZer0
UserZer0

Reputation: 1501

And to learn ajax i would recommend using jquery rather then reinventing the wheel. this tutorial will get you started http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery

also for the php side this will be helpful http://www.w3schools.com/php/php_ajax_intro.asp

Upvotes: 1

GordonM
GordonM

Reputation: 31730

You need to use a technology called AJAX to achieve this. As your question is not very specific the answer can't be either I'm afraid, but the general idea is a javascript running in the browser polls the server every couple of minutes for data, and the server returns some (XML in true AJAX, JSON, a HTML fragment, etc). The script then processes the data and modifies the DOM based on the results of the processing.

Upvotes: 1

Related Questions