<pre name="code" class="javascript">//获取xml文件
function loadXmlFile(xmlFile){
var xmlDom = null;
if (window.ActiveXObject){
xmlDom = new ActiveXObject("Microsoft.XMLDOM");
xmlDom.async=false;
xmlDom.load(xmlFile)||xmlDom.loadXML(xmlFile);//如果用的是XML字符串//如果用的是xml文件
}else if (document.implementation && document.implementation.createDocument){
var xmlhttp = new window.XMLHttpRequest();
xmlhttp.open("GET", xmlFile, false);
xmlhttp.send(null);
xmlDom = xmlhttp.responseXML;
}else{
xmlDom = null;
}
return xmlDom;
}
//判断子节点为不为空
function isnull(obj)
{
var nodevalue = "";
if(obj.childNodes[0] != null)
{
nodevalue =obj.childNodes[0].nodeValue;
}
return nodevalue;
}
var stringsss="";
//获得页面内容
function getContent(content){
//exBrows();
var val = encodeURI(content);
orderDoc=loadXmlFile("http://www.tuling123.com/openapi/productexp.do?info="+val);
items=isnull(orderDoc.getElementsByTagName("Content")[0]);//.nodeValue;
}
var div = document.getElementById("chat_message");
div.scrollTop = div.scrollHeight;