Home  >  Article  >  Web Front-end  >  使用时间戳解决ie缓存的问题_javascript技巧

使用时间戳解决ie缓存的问题_javascript技巧

WBOY
WBOYOriginal
2016-05-16 16:39:041150browse

在开发测试中,如果选择ie,当编辑某条数据时,再回过头来进行编辑,会发现,里面的数据和没有编辑以前是一样的, 这和种情况下,解决ie缓存成了问题。我的方法是,在请求链接后面加上一个时间戳,就只可以避免这种问题的出现。

复制代码 代码如下:

var getTimestamp=new Date().getTime(); //时间戳
var _url = "${pageContext.request.contextPath}/productData/addShow.do?productDataId="+value+"&timer=" + getTimestamp;
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn