开发者

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?


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.


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.


Add it in a function and do a return false.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜