When I used the setTimeOut() in the document.ready function, it didn’t work.
Here’s the code I’ve used:
$(document).ready(function(){
function abc{
alert('Hi');
}
setTimeOut (abc, 2000);
});
What did I miss?
Thank you 🙂
It is spelt
setTimeout(lowercase “o”)Also you can and should be able to find issues like these yourself. The only magic part that you need to know is that browsers tend to “swallow” exceptions thrown inside DOM and AJAX event handlers. So there is actually an exception thrown in your code. You can however easily deduce that by adding more
alert()orconsole.log()statements on every line.