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