Put it in the header of the Javascript file, like C # (using...) or Java (import ...)
$. Extend ( {
Includepath :'',
Include: Function (File){
VaR Files = Typeof File = "string "? : File;
For ( VaR I = 0; I <files. length; I ++){
VaRName = files [I]. Replace (/^ \ s | \ S $/g ,"");
VaRATT = Name. Split ('.');
VaREXT = ATT [Att. Length-1]. tolowercase ();
VaRIscss = ext = "CSS ";
VaRTag = iscss? "Link": "script ";
VaRATTR = iscss? "Type = 'text/CSS 'rel = 'stylesheet'": "Language = 'javascript 'Type = 'text/JavaScript '";
VaRLink = (iscss? "Href": "src") + "= '" + $. includepath + name + "'";
If($ (TAG + "[" + link + "]"). length = 0) document. write ("<" + tag + ATTR + link + "> </" + tag + "> ");
}
}
});
Call Method
$. Export depath = 'js or CSS path ';
$. Include (['jquery. Tree. js', 'jquery.tree.css ']);
Address: http://www.cnblogs.com/chenjinfa/archive/2009/03/17/1414178.html
Download