此代码工作正常但在IE中工作,我需要谷歌Chrome感谢。
var isRefresh;
function detectRefresh(){
try
{
if(window.opener.title == undefined){
isRefresh = true;
document.write('Window was refreshed!');
}
}
catch(err)
{
isRefresh = false;
document.write('Window was closed!');
}
}