How to reload a div without reloading the entire page?
How to reload or refresh a div without reloading the entire page using jquery
In this tutorial, you will be learning how can we refresh a DIV without reloading the whole page.
Now, Let's refresh a div content using jquery without any page reload on a Button Click. jQuery.load() method is probably the easiest way to load data asynchronously using a selector, but you can also use any of the jquery ajax methods (get, post, getJSON, ajax, etc.)
Note that load allows you to use a selector to specify what piece of the loaded script you want to load, as in given below:
Example 1: Let's create a index.php and print the TIME using date() function in a "<div>" tag and reload this div without page reload or refresh, using jquery. We will be using jQuery setInterval() method to call that load() method to refresh div content every 1 second as given below:
Thanks for reading.
© Copyright - 2018 - 2023 | All rights reserved at Funda of Web IT