<script language= "Web Effects" type= "Text/javascript"
<!--
Function Jsloader () {
this.load= function (URL) {
//gets all <scrcipt> tags
var ss=document.getelementsbytagname (" Script "); The
//determines whether the specified file already contains, if it is already included, triggers the Onsuccess event and returns
for (i=0;i<ss.length;i++) {
if (ss[i].src && ss[i].src.indexof (URL)!=-1) {
this.onsuccess ();
return;
}
}
//creates a script node and sets its properties to be an external JavaScript file
s=document.createelement ("script");
s.type= "Text/javascript";
s.src=url;
//Gets the head node and inserts <script> into it
var head=document.getelementsbytagname ("Head") [ 0];
head.appendchild (s);
//Gets the reference to the object itself
var self=this;
//for IE browsers, use the ReadyStateChange event to determine whether to load successfully
//for other browsers, use the OnLoad event to determine whether the load was successful
s.onload=s.onreadystatechange=function () {
//this pointer in this function refers to an S-node object, not a Jsloader instance,
//so you have to use self to invoke the Onsuccess event, the same below.
if (this.readystate && this.readystate== "Loading") return;
self.onsuccess ();
}
s.onerror=function () {
//If an error occurs, delete the inserted node and trigger the failed event
Head.removechild (s);
self.onfailure ();
}
};
//Define Load Success Events
this.onsuccess=function () {};
//define load failed events
this.onfailure= function () {};
}
//Create Object
var jl=new jsloader ();
//define load successful handler
Jl.onsuccess=function () {
sayhello ();
}
//Define Load Failure handler
Jl.onfailure=function () {
alert ("File load failed! ");
}
//Start loading
jl.load ("Hello.js");
//-->
</script>