function createXMLHttpRequest()
{
if(window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
}
{
if(window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
}
var xmlhttp;
function createXMLHttp()
{
if(window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();// 在非Microsoft浏览器中创建XMLHttpRequest对象
}
else if(window.ActiveXObject)
{
try{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");//尝试按老版InternetExplorer方法创建
}
catch(e1){
try{
xmlhttp= new ActiveXObject("Msxml2.XMLHTTP");// 尝试按新版InternetExplorer方法创建
}
catch(e2)
{
alert("创建XMLHttpRequest对象失败.");
}
}
}
}
</script>
自己去找一下...
我忘了...
var oXmlDom = document.implementation.createDocument("", "", null);
然后就可以load()...
字符串形式的话要用DOMParser...
相关的自己去找...
然后就可以load()...
字符串形式的话要用DOMParser...如果实在不行,看一些相关的书籍
http://book.csdn.net/bookfiles/46/100466986.shtml