我正在使用 window.location.href
进行重定向。
但它所做的只是获取旧页面(不显示新添加的项目),这些页面以前存储在浏览器缓存中。
我希望它从服务器获取所有内容,就像我们在 document.location.reload(true)
中使用 true
参数一样,从服务器加载页面的最新副本。
我正在使用 window.location.href
进行重定向。
但它所做的只是获取旧页面(不显示新添加的项目),这些页面以前存储在浏览器缓存中。
我希望它从服务器获取所有内容,就像我们在 document.location.reload(true)
中使用 true
参数一样,从服务器加载页面的最新副本。
window.location.href = "http://www.mywebsite.com/products?t="+ (new Date().getTime());
或者:
window.location.href = "http://www.mywebsite.com/products?t="+ Math.random();
window.location.href = "http://www.mywebsite.com/products"
。 - Umair Ayub