JS 如何清除页面缓存

JavaScript022

JS 如何清除页面缓存,第1张

1.动态页面:index.asp?id=....

2.使用jquery,$.ajaxSetup({cache : false })

3.在html里的head标签中加

<meta http-equiv ="proma" content = "no-cache"/>

<meta http-equiv="cache-control" content="no cache" />

<meta http-equiv="expires" content="0" />

另外一种:

<html http-equiv="proma" content="no-cache"/>

<html http-equiv="content-type" content="no-cache , must-revalidate"/>

<http http-equiv="expires" content=" Wed , 26 Feb 1997 08:21:57 GMT"/>

另外 ,在提交信息时,总是出现旧的内容,此时就应该考虑是本地浏览器缓存的原因了。

清空临时缓存的方法:

<body onload ="javascript : document.yourFormName.reset()">

nodejs清理谷歌浏览器缓存方法如下。

1、打开需清缓存的页面,再按F12调出开发模式框。

2、勾选Network标签下Disablecache选项。

3、按F5或右键重新加载刷新页面内容。

4、页面重新加载完成再按F12隐藏开发模式框即可清理谷歌浏览器缓存。

1、新建一个html页面,命名为test.html。

2、在test.html页面内,使用p标签创建三行文字。

3、在p标签的下面,创建一个button按钮,按钮名称为“清除网页内容”。

4、给button按钮绑定onclick点击事件,当按钮被点击时,执行delAll()函数。

5、在test.html页面内,使用function创建delAll函数。

6、在delAll函数内,获得当前页面body对象,使用innerHTML属性赋值为空的方法清除网页内容。

7、在浏览器中打开test.html页面,点击“清除网页内容”按钮,网页显示空白,内容被清除。