日期:2014-05-16 浏览次数:20633 次
// refresh.html (function(){ function getRefreshLevel() { var search = window.location.search || '?level=0'; var request = /\??level=(.*)\b/g.exec(search); if(request && request.length) { return request[1]; } return null; } var refreshlevel = parseInt(getRefreshLevel()); if(!isNaN(refreshlevel) && refreshlevel < 4) { setTimeout(function() { var dd = 'refresh.html?level=' + (++refreshlevel); window.location.href = dd;//'refresh.html?refresh=' + (++refreshlevel); }, 3000); } // test if(refreshlevel > 0) alert('fresh ' + refreshlevel + ' times.'); })();