Home  >  Article  >  Web Front-end  >  Ajax method to regularly update a certain piece of content on the page

Ajax method to regularly update a certain piece of content on the page

亚连
亚连Original
2018-05-25 10:38:541705browse

This article mainly introduces the Ajax method to regularly update a certain piece of content on the page, involving related techniques of Ajax calling of the load method in jquery and setInterval timing execution. It has certain reference value. Friends who need it can refer to it

The example of this article describes the method of regularly updating a certain piece of content on the page using Ajax. Share it with everyone for your reference. The specific implementation method is as follows:

function updateShouts(){
  // Assuming we have #shoutbox
  $('#shoutbox').load('latestShouts.php');
}
setInterval( "updateShouts()", 10000 );

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

Ajax method to obtain response content length

ajax method to traverse xml document

Simple implementation of Ajax displaying progress during the request process

The above is the detailed content of Ajax method to regularly update a certain piece of content on the page. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn