javascript - How to get iframe's readyState -


this html

<div ng-if="isloaddone" class="col-xs-12">     <div class="text-center"><span class="fa fa-spinner fa-pulse fa-5x fa-fw margin-bottom"></span></div>   </div> <iframe id="appid" ng-if="isloaddone" class="app-iframe" ng-src="{{trustedapplurl}}"></iframe> 

and in javascript:

$elem = angular.element('#appid'); 

in debug console

$elem show context:document    .......    readystate: "complete" 

i don't know how readystate using $elem $elem.context.document.readystate didn't work. idea how readystate using $elem thanks

you use readystatechange , onload determine it, like:

//check ie if (navigator.useragent.indexof("msie") > -1 && !window.opera){     youriframe.onreadystatechange = function(){         if (youriframe.readystate == "complete"){             alert("iframe loaded.");         }     }; } else {     youriframe.onload = function(){         alert("iframe loaded.");     }; } 

note:: ie's readystatechange different readystatechange event fired on xmlhttprequest objects. starting internet explorer 11, onload should used.


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -