Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/365.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 谁能解释一下在页面中自动更新最新帖子的最佳方式是什么?_Php_Javascript - Fatal编程技术网

Php 谁能解释一下在页面中自动更新最新帖子的最佳方式是什么?

Php 谁能解释一下在页面中自动更新最新帖子的最佳方式是什么?,php,javascript,Php,Javascript,谁能解释一下在页面中自动更新最新帖子的最佳方式是什么 (Newly added posts will just prepend to the old wall posts) 及 像twitter和facebook一样,他们每隔一段时间就会更新一次wall 他们使用的技术是什么 (我知道我可以在JS中设置时间间隔。但只有在系统中添加任何新帖子时,我才需要向服务器发送请求。) 您可以在服务器上设置cron作业。。它将在指定的时间间隔运行页面 您可以在此url上找到它: “但只有当系统中添加了新帖子

谁能解释一下在页面中自动更新最新帖子的最佳方式是什么

(Newly added posts will just prepend to the old wall posts)

像twitter和facebook一样,他们每隔一段时间就会更新一次wall

他们使用的技术是什么


(我知道我可以在JS中设置时间间隔。但只有在系统中添加任何新帖子时,我才需要向服务器发送请求。)


您可以在服务器上设置cron作业。。它将在指定的时间间隔运行页面

您可以在此url上找到它:


“但只有当系统中添加了新帖子时,我才需要向服务器发送请求。”除非您询问系统,否则您不知道是否有新帖子要显示。使用一个间隔并询问它。你看了吗No
AJAX
?有点像,系统中会运行一些cron来检查最新的更新,如果是的话,会向浏览器(客户端)发出一些请求,告诉浏览器对服务器进行AJAX调用(而不是使用setInterval进行多次AJAX调用)如何使用服务器端cron更新页面的某些区域(DIV)。
 (The number which tells number of newly added posts. 
Number should be displayed in the top of the wall.)
(Using cron or something we can just go and hit the client ?.
 In phone there is a method called "PUSH". )