从服务器创建window.location.href加载页面而不是浏览器缓存

时间:2016-07-23 18:19:59

标签: javascript jquery codeigniter redirect

在成功进行CREATE操作后将Item添加到DB后,我使用window.location.href重定向到列表视图。

但是它做了什么,它只是获取以前在borwser缓存中的旧页面(不显示新添加的项目)。

我希望它能从服务器中获取每个想法,就像我们在true中使用document.location.reload(true)参数从服务器加载新的页面副本一样。

1 个答案:

答案 0 :(得分:3)

您可以使用:

window.location.href = "http://www.mywebsite.com/products?t="+ (new Date().getTime());

或者:

window.location.href = "http://www.mywebsite.com/products?t="+ Math.random();
相关问题