Alright, I think I got what you're asking for. Try this
if(window.top==window) {
// You're not in a frame, so you reload the site.
window.setTimeout('location.reload()', 3000); //Reloads after three seconds
}
else {
//You're inside a frame, so you stop reloading.
}
If it is once, then just do
$('#div-id').triggerevent(function(){
$('#div-id').html(newContent);
});
If it is periodically
function updateDiv(){
//Get new content through Ajax
...
$('#div-id').html(newContent);
}
setInterval(updateDiv, 5000); // That's five seconds
So, every five seconds the div #div-id content will refresh. Better than refreshing the whole page.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…