Skip to content

Instantly share code, notes, and snippets.

Created March 18, 2010 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/336447 to your computer and use it in GitHub Desktop.
Save anonymous/336447 to your computer and use it in GitHub Desktop.
------------- file that loads first
function loader()
{
var uri = 'http://a.com/skeleton.js';
var headID = document.getElementsByTagName("head")[0];
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = uri;
headID.appendChild(newScript);
}
loader();
some functions affects on skeleton built before
var foo= function(){}
----------------------skeleton.js
function skeleton_init(){
//Drawing some divs here
setTimeout(foo, 1000); //<-cannot run this if simply copypaste content instead of function
}
skeleton_init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment