Last active
October 11, 2016 14:09
-
-
Save chrismay/64989cdeaa94a10fa5fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title> - jsFiddle demo</title> | |
<style type='text/css'> | |
</style> | |
<script type='text/javascript'>//<![CDATA[ | |
var VanillaRunOnDomReady = function() { | |
var content = document.getElementById("content"); | |
for (i=0; i<=10;i++){ | |
var newLine = document.createElement("p"); | |
newLine.appendChild(document.createTextNode("This is paragraph number " + i)); | |
content.appendChild(newLine); | |
} | |
} | |
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); | |
}//]]> | |
</script> | |
</head> | |
<body> | |
<h1>Test</h1> | |
<div id="content"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment