Dynamic updates in social networking webpages
I am creating a social networking site using php,jQuery and MySQL. I have a big 开发者_开发知识库doubt. How to dynamically update a user's home page when one of his/her friends does an action and if that has to appear on current user's page as soon as the friend has updated. I am new to this, please help me in this problem?
It looks like you're looking for a way to implement push functionality from your web server to a current user's page.
The push data will be sent as part of a friends' action or soon after (in a queued fashion), and once it arrives to the client Javascript should be used to update the view.
Some methods of doing that are described on the push technologies Wikipedia page.
You can add a JavaScript timer function in web page side. And regularly to check whether new information is gather. If there is information, then add new information in the page or notice user.
This is a jQuery Timer.
This is function of jQuery.ajax(). You can use this function in jQuery Timer to check whether there have new information.
If there have new content, you can use "Adding elements to the DOM" to display them out. This is a reference for this topic, Adding elements to the DOM.
I think this way would be helpful.
精彩评论