获取或转换XML对象,从string和URL中获取
businessObj.loadXMLString = function(xmlString, callback, parameter){
var xml = new ActiveXObject("Microsoft.XMLDOM");
xml.onreadystatechange=xmlRead;
xml.async = false;
function xmlRead(){
if (xml.readyState == 4){
if (callback){
if (parameter){
callback.apply(xml,parameter);
}else{
callback.apply(xml);
}
}
}
}
xml.loadXML(xmlString);
return xml;
}
/**
读取XML的方法async = false
xmlURL-文件的URL
**/
businessObj.loadXML = function(xmlURL, callback, parameter){
var xml = new ActiveXObject("Microsoft.XMLDOM");
xml.onreadystatechange=xmlRead;
xml.async = false;
function xmlRead(){
if (xml.readyState == 4){
if (callback){
if (parameter){
callback.apply(xml,parameter);
}else{
callback.apply(xml);
}
}
}
}
xml.load(xmlURL);
return xml;
}
var xml = new ActiveXObject("Microsoft.XMLDOM");
xml.onreadystatechange=xmlRead;
xml.async = false;
function xmlRead(){
if (xml.readyState == 4){
if (callback){
if (parameter){
callback.apply(xml,parameter);
}else{
callback.apply(xml);
}
}
}
}
xml.loadXML(xmlString);
return xml;
}
/**
读取XML的方法async = false
xmlURL-文件的URL
**/
businessObj.loadXML = function(xmlURL, callback, parameter){
var xml = new ActiveXObject("Microsoft.XMLDOM");
xml.onreadystatechange=xmlRead;
xml.async = false;
function xmlRead(){
if (xml.readyState == 4){
if (callback){
if (parameter){
callback.apply(xml,parameter);
}else{
callback.apply(xml);
}
}
}
}
xml.load(xmlURL);
return xml;
}
--------------------------------------------------------------------------
今天,明天就在此刻!此刻奋斗,今天耕耘,明天收获,明天辉煌!此刻放弃, 今天无为,明天饥饿,明天黯淡!
JimmyCai