Refresh page using jQuery


Refresh page using jQuery : There are many ways to refresh a page using jQuery. You can use location.reload(). Here in this tutorial we are going to explain some of common used methods to reload the page in jQuery. We will explain this with example and demo.


Refresh page using jQuery

You use the following methods to refresh the page in jQuery –

Method 1 : Using location.reload()

You can use location.reload() to refresh a page. Here is an example-

Refresh page using jQuery Example:

$('#refresh').click(function() {
    location.reload();
});

Try it »

If You run the above example it will produce output something like this-

Refresh page using jQuery

Note : The above link is image output only for demo click above “Try It” Button.

Method 2 : Using history.go(0)

You can use history.go(0) to refresh a page. Here is an example-

Refresh page using jQuery Example:

$('#refresh').click(function() {
    history.go(0);
});

Try it »

If You run the above example it will produce output something like this-

Refresh page using jQuery

Note : The above link is image output only for demo click above “Try It” Button.

Advertisements

Add Comment

📖 Read More