これはリレーベントの行です。javascript clearTimeoutが子ページから機能していない
// In the parent page I set the timer and attach its handle to the window
window.warnTo = window.setTimeout("WarnTimeout();", 20000);
// If I clear the timer in the same page it works great
window.clearTimeout(window.warnTO);
// In the child page launched with window.open,
// I try to clear the timer and the timer still fires
window.opener.clearTimeout(window.opener.warnTO);
すべての変数が設定されているように見え、window.openerが親ウィンドウのようです。 私は困惑しています。
通常、 'setTimeout'や' setInterval'に文字列引数を使うべきではありませんが、この場合はOKです。 –