Skip to main content

Refresh certain elements of a page using jQuery after a set amount of time, can be used with any element with an ID. I amended the example given with the URL to only refresh once and not intermittently. Works in all browsers.

$('#button1').click(function () {

  var url = "" + Math.random(); //create random number

  setTimeout(function () {
    $("#elementName").load(url + " #elementName>*", "");
  }, 1000); //wait one second to run function