var type = xml.getElementsByTagName("Type");
if (type.length > 0) {
var typeValue = type[0];
var value = typeValue.firstChild.nodeValue;
if (value == "nodata") {
alert("没有数据,请联系管理员!");
typeValue.SetAttribute("Type","data");//这里要删除接点或修改怎么做
}
}
if (type.length > 0) {
var typeValue = type[0];
var value = typeValue.firstChild.nodeValue;
if (value == "nodata") {
alert("没有数据,请联系管理员!");
typeValue.SetAttribute("Type","data");//这里要删除接点或修改怎么做
}
}
...//修改
typeValue.parentNode.replaceChild(newNode,typeValue);
修改的话你可以先删除节点再重新创建这个节点
能给个详细的代码吗
这个是偶的帮看看:
xh传近来的参数
if (xh != null && xh.readyState == 4 && xh.status == 200) {
var xml = xh.responseXML;
var type = xml.getElementsByTagName("Type");
if (type.length > 0) {
var typeValue = type[0];
var value = typeValue.firstChild.nodeValue;
if (value == "nodata") {
alert("没有数据,请联系管理员!");
typeValue.parentNode.removeChild(typeValue);//这里要删除接点
}
}