Mohan Ram
Mohan Ram

Reputation: 8463

How to refresh a page in jquery?

I need to refresh the page using jquery? I am using

location.reload(true);
This code reloads the page i need to refresh the page(Once a page refresh user entered content would be there). how to refresh?

Upvotes: 0

Views: 851

Answers (4)

Aivan Monceller
Aivan Monceller

Reputation: 4670

add this to your form element autocomplete="off" that should do the trick

Upvotes: 0

Pascal H.
Pascal H.

Reputation: 54

Add it in a function and do a return false.

Upvotes: 0

ThiefMaster
ThiefMaster

Reputation: 318488

Use only location.reload(); - note that this will not disable caching for the reload. But you cannot preserve both form fields and reload without using anything from cache.

It's very similar to F5 vs CTRL+F5: The first one does not disable all caching but preserves form fields. The latter does not load anything from cache and resets form fields.

Upvotes: 4

rahul
rahul

Reputation: 187030

AFAIK jQUery will not be helpful in this scenario.

If you are using HTML controls it will not preserve the value after refresh. If you want to preserve the value then you need to use server side controls.

Upvotes: 0

Related Questions