1
var net=new Object();
2
net.READY_STATE_UNINITIALIZED=0;
3
net.READY_STATE_LOADING=1;
4
net.READY_STATE_LOADED=2;
5
net.READY_STATE_INTERACTIVE=3;
6
net.READY_STATE_COMPLETE=4;
7![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
net.ContentLoader=function(url,onload,onerror)
{
8
this.url=url;
9
this.req=null;
10
this.onload=onload;
11
this.onerror=(onerror) ? onerror : this.defaultError;
12
this.loadXMLDoc(url);
13
}
14![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
net.ContentLoader.prototype=
{
15![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
loadXMLDoc:function(url)
{
16![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (window.XMLHttpRequest)
{
17
this.req=new XMLHttpRequest();
18![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
} else if (window.ActiveXObject)
{
19
this.req=new ActiveXObject("Microsoft.XMLHTTP");
20
}
21![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (this.req)
{
22![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
try
{
23
var loader=this;
24![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
this.req.onreadystatechange=function()
{
25
loader.onReadyState.call(loader);
26
}
27
this.req.open('GET',url,true);
28
this.req.send(null);
29![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
}catch (err)
{
30
this.onerror.call(this);
31
}
32
}
33
},
34![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
onReadyState:function()
{
35
var req=this.req;
36
var ready=req.readyState;
37![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (ready==net.READY_STATE_COMPLETE)
{
38
var httpStatus=req.status;
39![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (httpStatus==200 || httpStatus==0)
{
40
this.onload.call(this);
41![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
}else
{
42
this.onerror.call(this);
43
}
44
}
45
},
46![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
defaultError:function()
{
47
alert("error fetching data!"
48
+"\n\nreadyState:"+this.req.readyState
49
+"\nstatus: "+this.req.status
50
+"\nheaders: "+this.req.getAllResponseHeaders());
51
}
52
}
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/None.gif)
3
![](/Images/OutliningIndicators/None.gif)
4
![](/Images/OutliningIndicators/None.gif)
5
![](/Images/OutliningIndicators/None.gif)
6
![](/Images/OutliningIndicators/None.gif)
7
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/dot.gif)
8
![](/Images/OutliningIndicators/InBlock.gif)
9
![](/Images/OutliningIndicators/InBlock.gif)
10
![](/Images/OutliningIndicators/InBlock.gif)
11
![](/Images/OutliningIndicators/InBlock.gif)
12
![](/Images/OutliningIndicators/InBlock.gif)
13
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
14
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/dot.gif)
15
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/ContractedSubBlock.gif)
![](/Images/dot.gif)
16
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/ContractedSubBlock.gif)
![](/Images/dot.gif)
17
![](/Images/OutliningIndicators/InBlock.gif)
18
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/ContractedSubBlock.gif)
![](/Images/dot.gif)
19
![](/Images/OutliningIndicators/InBlock.gif)
20
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
21
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/ContractedSubBlock.gif)
![](/Images/dot.gif)
22
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/ContractedSubBlock.gif)
![](/Images/dot.gif)
23
![](/Images/OutliningIndicators/InBlock.gif)
24
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/ContractedSubBlock.gif)
![](/Images/dot.gif)
25
![](/Images/OutliningIndicators/InBlock.gif)
26
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
27
![](/Images/OutliningIndicators/InBlock.gif)
28
![](/Images/OutliningIndicators/InBlock.gif)
29
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/ContractedSubBlock.gif)
![](/Images/dot.gif)
30
![](/Images/OutliningIndicators/InBlock.gif)
31
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
32
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
33
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
34
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/ContractedSubBlock.gif)
![](/Images/dot.gif)
35
![](/Images/OutliningIndicators/InBlock.gif)
36
![](/Images/OutliningIndicators/InBlock.gif)
37
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/ContractedSubBlock.gif)
![](/Images/dot.gif)
38
![](/Images/OutliningIndicators/InBlock.gif)
39
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/ContractedSubBlock.gif)
![](/Images/dot.gif)
40
![](/Images/OutliningIndicators/InBlock.gif)
41
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/ContractedSubBlock.gif)
![](/Images/dot.gif)
42
![](/Images/OutliningIndicators/InBlock.gif)
43
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
44
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
45
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
46
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/ContractedSubBlock.gif)
![](/Images/dot.gif)
47
![](/Images/OutliningIndicators/InBlock.gif)
48
![](/Images/OutliningIndicators/InBlock.gif)
49
![](/Images/OutliningIndicators/InBlock.gif)
50
![](/Images/OutliningIndicators/InBlock.gif)
51
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
52
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)