【发布时间】:2013-10-27 14:26:50
【问题描述】:
我有点迷茫。
我有两页;结果和细节。每当用户使用浏览器后退按钮从详细信息导航到结果时,结果页面应该刷新,这样我可以显示用户刚刚在详细信息上看到的产品(就像亚马逊对最近查看的项目所做的那样)
不知道加载页面asynchronously是否更好, 或使用here 所见的 setTimeout(下面的示例有效,但页面会永远刷新)
if(window.top==window) {
// you're not in a frame so you reload the site
window.setTimeout('location.reload()', 3000); //reloads after 3 seconds
} else {
//you're inside a frame, so you stop reloading
}
当我尝试重新加载一个 div 时也不起作用
$('#div-id').triggerevent(function(){
$('#div-id').html(newContent);
});
我也遇到了很多导致this 的示例,但没有成功。 欢迎任何建议。 谢谢
【问题讨论】:
标签: javascript jquery asynchronous