This is the code:
var LOAD = window.setInterval("LOADING()", 50);
function LOADING() {
var y = document.getElementById("cse");
var str = y.innerHTML;
if (str !== "Loading") {
setTimeout('INPUTAI()', 100);
window.clearInterval(LOAD);
console.log('Google paieška užsikrovė');
}
}
Then page loads and then “Loading” dissmises, in my Google Chrome console I see “Google paieška užsikrovė”, but it keeps writing to console, and writing… So clearInterval not works.
Problem solved: changed to
var LOAD = window.setInterval(LOADING, 50);
Thanks 😉
setIntervaldoes not need the function’s():Also, as many people ponted out, the problem may be with the
#cseelement’s content not being exactly"Loading".