How do I refresh a DIV content?

To reload a section of the page, you could use jquerys load with the current url and specify the fragment you need, which would be the same element that load is called on, in this case #here:

function updateDiv()
    $( "#here" ).load(window.location.href + " #here" );
  • Don’t disregard the space within the load element selector: + " #here"

This function can be called within an interval, or attached to a click event

Leave a Comment