Rate this script:  I Love it  /   I Hate it

Simple JS Include function


Code


function $include(path)
{
var x, base, src = "root.js", scripts = document.getElementsByTagName("script");
for (x=0; x<scripts.length; x++){if (scripts[x].src.match(src)){ base = scripts[x].src.replace(src, "");break;}}
document.write("<" + "script src=\"" + base + path + "\"></" + "script>");
}
 

 

 
Simple JS Include function scripts | Simple JS Include function snippet | Simple JS Include function example | Simple JS Include function tutorial | Simple JS Include function code