3
我需要一个代码,当CheckForZero
第一次发生,30秒后再次发生,它每30秒进行一次。延迟功能与greasemonkey
var waitForZeroInterval = setInterval (CheckForZero, 0);
function CheckForZero()
{
if ((unsafeWindow.seconds == 0) && (unsafeWindow.milisec == 0))
{
clearInterval (waitForZeroInterval);
var targButton = document.getElementById ('bottone1799');
var clickEvent = document.createEvent ('MouseEvents');
clickEvent.initEvent ('click', true, true);
targButton.dispatchEvent (clickEvent);
}
};
此代码只有一次...我需要它去每30秒 – Riccardo
然后更换的setTimeout()在使用setInterval( )。不过,在初始调用中使用setTimeout(),可以消除cancelInterval()调用。 – sarumont