1

I am trying a small experiment. Request you guys to please clarify my doubt. I am hitting a random web page and when the web page is not fully loaded, I am trying to invoke the following javascript code to just see if the document object has been created or not.

var intervalId = setInterval(function(){
    console.log(typeof document !== 'undefined');
},500); 

When the above code is run, it goes on printing false even when the page has fully loaded

Can anyone explain?

Javascript code is getting cached but how would I get a workaround on this type of problem.

Juvenik
  • 900
  • 1
  • 8
  • 26

0 Answers0