Skip to content

Instantly share code, notes, and snippets.

@javascripter
Created May 23, 2009 03:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javascripter/116481 to your computer and use it in GitHub Desktop.
Save javascripter/116481 to your computer and use it in GitHub Desktop.
(function () {
var scripts = document.getElementsByTagName("script");
var me = scripts.item(scripts.length - 1);
function evaluate() {
var script = document.createElement("script");
script.type = me.type;
script.appendChild(document.createTextNode(me.textContent));
document.body.appendChild(script);
document.body.removeChild(script);
}
if (document.readyState == "complete")
evaluate();
else
window.addEventListener("DOMContentLoaded", evaluate, false);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment