0

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?

2
  • I really dont understand the question. But location.reload() will work, i dont think you need the true in there... Commented Dec 1, 2010 at 12:39
  • Refresh and reload are usually synonyms. Can you be more precise with what you're trying to do? window.location.reload(true); isn't what you want? Commented Dec 1, 2010 at 12:41

4 Answers 4

4

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

0

Add it in a function and do a return false.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.