Jhonatan Rico Jhonatan Rico - 1 month ago 11
jQuery Question

VM456:22 Uncaught ReferenceError: wndow is not defined

I am new at javascript, I am trying to make a script to reload a web page after some time but when the time is complete the error shows up and it does not reload the page.

var url = window.location.href;
console.log("My url: "+url);
console.log("Ten seconds");
setTimeout(function(){reload();}, 10000);

function reload(){
console.log("Refreshing to... " + url);
wndow.location.href = url;
}


I do not know what to do :(

Answer

You have a spelling mistake.

wndow.location.href = url;