jquery controls how part of the page is refreshed

  • 2020-06-19 09:44:36
  • OfStack

This article gives an example of how jquery controls partial page refreshes. Share to everybody for everybody reference. The specific analysis is as follows:

This code is cleverly designed to load the contents of the page's specified label via jQuery's load method

$('#button1').click(function() {
  var url = "http:www.your-url.com?ID=" + Math.random();
  //create random number
  setTimeout(function() {
  $("#elementName").load(url+" #elementName>*","");
  }, 1000); //wait one second to run function

Hopefully, this article has been helpful in your jQuery programming.

Related articles: