function callback(res){
var node = document.createelement('div');
node.innerhtml = res;
document.body.appendchild(node);
var scriptnodes = node.getelementsbytagname('script');
var len = scriptnodes.length;
var stylenodes = node.getelementsbytagname('style');
var len1 = scriptnodes.length;
for(var i=0; i var scriptnode = document.createelement('script');
if(scriptnodes[0].getattribute('src')!='' && scriptnodes[0].getattribute('src')!=null){
scriptnode.setattribute('src',scriptnodes[0].getattribute('src'));
}else{
scriptnode.innerhtml = scriptnodes[0].innerhtml;
}
document.body.appendchild(scriptnode);
node.removechild(scriptnodes[0]);
}
for(var i=0; i var stylenode = document.createelement('style');
if(stylenodes[0].getattribute('src')!='' && stylenodes[0].getattribute('src')!=null){
stylenode.setattribute('src',stylenodes[0].getattribute('src'));
}else{
stylenode.innerhtml = stylenodes[0].innerhtml;
}
document.head.appendchild(stylenode);
node.removechild(stylenodes[0]);
}
}
var xhr = null;
if(window.xmlhttprequest){
xhr = new xmlhttprequest();
}else if(window.activexobject){
xhr = new activexobject(microsoft.xmlhttp)
}
xhr.onreadystatechange = function(){
if(xhr.readystate == 4){
if(xhr.status == 200){
callback(xhr.responsetext);
}
}
}
xhr.open('get', 'main.html');
xhr.send(null);