Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var VanillaRunOnDomReady = function() {
- // your JavaScript code on jsFiddle
- }
- var alreadyrunflag = 0;
- if (document.addEventListener)
- document.addEventListener("DOMContentLoaded", function(){
- alreadyrunflag=1;
- VanillaRunOnDomReady();
- }, false);
- else if (document.all && !window.opera) {
- document.write('<script type="text/javascript" id="contentloadtag" defer="defer" src="javascript:void(0)"><\/script>');
- var contentloadtag = document.getElementById("contentloadtag")
- contentloadtag.onreadystatechange=function(){
- if (this.readyState=="complete"){
- alreadyrunflag=1;
- VanillaRunOnDomReady();
- }
- }
- }
- window.onload = function(){
- setTimeout("if (!alreadyrunflag){VanillaRunOnDomReady}", 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement