将数据推送到客户端

I like using PHP and JavaScript with jQuery.

I am displaying a list of items out of a SQL database using PHP. I have a button that opens up a new page in a new tab that will add an additional item to the database.

How would I add the newly added item in the database to the currently displayed list on the first page without refreshing that page?

I can force the page to make an ajax request every few seconds but I don't think that is very good practice.

I have been looking into sockets - however I don't know how to apply that knowledge to my current situation.

查看全部
weixin_33738982
?Briella
2014/08/03 15:27
  • php
  • ajax
  • javascript
  • jquery
  • 点赞
  • 收藏
  • 回答
    私信

3个回复