我正在使用此 ajax 函数将 html 页面重新加载到网页中的一个部分。
<script>
$('#scene_container').load('scene.html', function () {
cache: false
});
</script>
html:
<div id="scene_container"></div>
但大多数时候它会加载缓存的网页。如何加载原始html页面?
最佳答案
除非您全局禁用它,否则无法使用 load 方法防止缓存
但是您可以通过向请求 URL 附加时间参数来确保不会从缓存中加载任何数据
url = "scene.html";
url += '?_=' + (new Date()).getTime();
关于javascript - 没有缓存的ajax加载页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23407291/