<script type="text/javascript"> if(window.applicationCache){ window.applicationCache.addEventListener("error", function(e) { document.body.innerHTML = "Error fetching manifest: a good chance we are offline"; }); } function init() { var rjs = document.createElement("script"); rjs.src = "/assets/lib/require.js"; document.body.appendChild(rjs); var timer = setInterval(function(){ if(window.require) { require(["/init.js"]); clearInterval(timer); } }, 1); } if (window.addEventListener) window.addEventListener("load", init, false); else if (window.attachEvent) window.attachEvent("onload", init); else window.onload = init; </script>
Wednesday, October 8, 2014
init javascript with require.js after page loaded
Labels:
Javascript
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment