如何刷新jQuery页面? [英] How to refresh a page in jquery?

查看:96
本文介绍了如何刷新jQuery页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用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?

推荐答案

仅使用location.reload();-请注意,这不会禁用重新加载的缓存.但是,如果不使用缓存中的任何内容,就不能同时保留这两个表单字段.

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.

它与F5和CTRL + F5非常相似:第一个不会禁用所有缓存,但会保留表单字段.后者不会从缓存中加载任何内容,并且会重置表单字段.

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.

这篇关于如何刷新jQuery页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆