This component can load webpage files asynchronously. It must be supported by the Ajax component I wrote earlier !.
Its componentsCodeSource code of ajaxdiv. js
Function $ (Objid)
... {
ReturnDocument. getelementbyid (objid );
}
Function $ (Tagname)
... {
ReturnDocument. getelementsbytagname (tagname );
}
Function Ajaxdiv (objid, AutoFix, loadclass)
... {
// Alert (objid );
This . _ Id = Objid;
This . _ Loadclass = Loadclass;
This . _ AutoFix = AutoFix;
This . Init = Function ()
... {
VaR OBJ = $ ( This . _ Id );
If (( This . _ Loadclass ! = Null ) && ( This . _ Loadclass ! = "" ))
... {
OBJ. classname=This. _ Loadclass;
}
VaR Ajaxlib = New Ajaxlib ();
Ajaxlib. Method = " Get " ;
Ajaxlib. urlstring = OBJ. RL;
Ajaxlib. oncompletion = Function ()
... {
//Alert (ajaxlib. Response );
OBJ. innerhtml=Ajaxlib. response;
}
Ajaxlib. onloading = Function ()
... {
OBJ. innerhtml="<SPAN class = "fixie"> </span> initializing...";
}
Ajaxlib. onloaded = Function ()
... {
OBJ. innerhtml="<SPAN class = "fixie"> </span> Initialization is complete...";
}
Ajaxlib. oninteractive = Function ()
... {
OBJ. innerhtml="<SPAN class = "fixie"> </span> parsing the response...";
}
Ajaxlib. Send ();
If ( This . _ AutoFix)
... {
OBJ. style. Overflow="Visible";
}
Else
... {
OBJ. style. Overflow="Scroll";
}
} ;
This . INIT ();
}
Test File test.htm:
< Html >
< Head >
< Link Href = "Main.css" REL = "Stylesheet" Rev = "Stylesheet" >
< Script Language = "JavaScript" SRC = "Ajaxlib. js" > </ Script >
< Script Language = "JavaScript" SRC = "Ajaxdiv. js" > </ Script >
< Script Language = "JavaScript" > ...
Window. onload = Function ()
... {
VaR Ad = New Ajaxdiv ( " Ajaxdiv1 " , False );
VaR Ad2 = New Ajaxdiv ( " Ajaxdiv2 " , True )
}
</ Script >
</ Head >
< Body >
< Div Class = "Ajaxdiv" ID = "Ajaxdiv1" RL = "A1.htm" >
</ Div >
< Div Class = "Ajaxdiv" ID = "Ajaxdiv2" RL = "A2.htm" >
</ Div >
</ Body >
</ Html >
In this way, webpage files can be asynchronously loaded with a loading progress prompt.