2
好吧,首先,我几乎不知道Javascript。我真的不知道我在做什么。 所以,我有这样的代码:第二使用定时器(onload)
var interval_id = 0;
var prevent_bust = 0;
// Event handler to catch execution of the busting script.
window.onbeforeunload = function() { prevent_bust++ };
// Continuously monitor whether busting script has fired.
interval_id = setInterval(function() {
if (prevent_bust > 0) { // Yes: it has fired.
prevent_bust -= 2; // Avoid further action.
// Get a 'No Content' status which keeps us on the same page.
window.top.location = 'http://vadremix.com/204.php';
}
}, 1);
function clear()
{
clearInterval(interval_id);
}
window.onload="setTimeout(clear(), 1000)";
后1我要清除的时间间隔先前设置。这不起作用。我将如何做我想做的事?
谢谢!另外,感谢这些链接,显然,我一直有意要学习JavaScript一段时间,但从来没有想到 – James 2011-03-27 08:50:09