Skip to content

Instantly share code, notes, and snippets.

@sivy
Created January 31, 2011 17:25
Show Gist options
  • Select an option

  • Save sivy/804417 to your computer and use it in GitHub Desktop.

Select an option

Save sivy/804417 to your computer and use it in GitHub Desktop.
var script = document.createElement( 'script' );
script.type = 'text/javascript';
script.id = 'my_script';
script.src = '/path/to/script.js';
$('body').prepend(script); // doesn't show up in DOM (firebug)
$('body').append(script); // doesn't show up in DOM either (firebug)
$('#my_script').get(0); // undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment