标题:Set oXMLItems = oXMLRoot.selectNodes("//item")第9行缺少对象怎么解决 ...
取消只看楼主
夜龙魂
Rank: 2
等 级:论坛游民
帖 子:130
专家分:65
注 册:2009-9-24
结帖率:57.14%
 问题点数:0 回复次数:0 
Set oXMLItems = oXMLRoot.selectNodes("//item")第9行缺少对象怎么解决
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>

<%
Dim oXML, oXMLRoot, oXMLItems
set oXML = CreateObject("MSXML2.DOMDocument")
oXML.load Server.MapPath("bcaster.xml")

Set oXMLRoot = oXML.documentElement
Set oXMLItems = oXMLRoot.selectNodes("//item")
%>

<%

if(Trim(Request("AddNew")) = "Submit") then

Dim TmpNode
Set TmpNode = oXML.createElement("item")

TmpNode.setAttribute "item_url",Trim(Request("item_url"))
TmpNode.setAttribute "link",Trim(Request("link"))
TmpNode.setAttribute "itemtitle",Trim(Request("itemtitle"))

oXMLRoot.appendChild TmpNode

oXML.Save(Server.MapPath("bcaster.xml"))

end if
%>


<%

if(Trim(Request("WebMethod")) = "delete") then


Dim TmpNodes,Nodesss
Set TmpNodes = oXMLItems.item(Trim(Request("index")))

Set Nodesss = TmpNodes.parentNode
Nodesss.removeChild(TmpNodes)
oXML.Save(Server.MapPath("bcaster.xml"))

Response.end()
end if

%>


<%

if(Trim(Request("WebMethod")) = "edit") then

attrKey = split(Trim(Request("id")), "$")(0)
index = split(Trim(Request("id")), "$")(1)

oXMLItems.item(index).setAttribute attrKey, Trim(Request("value"))
oXML.Save(Server.MapPath("bcaster.xml"))

Response.Write(Trim(Request("value")))
Response.end()

end if

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="http://code.
<script src="http://www.
<style type="text/css">
<!--
a{
color:blue;
}

form {
margin:0px;
padding:0px;
}
-->
</style>
</head>
<body>
<form action="" method="post">
<table width="880" border="1" cellpadding="4" cellspacing="2">
<tr>
<td style="width:30%">item_url</td>
<td style="width:30%">link</td>
<td style="width:35%">itemtitle</td>
<td style="width:5%">Edit</td>
</tr>

<%
For i = 0 To oXMLItems.length - 1
%>

<tr>
<td><div id="item_url$<%= i %>" class="edit"><%= oXMLItems.item(i).getAttribute("item_url") %></div></td>
<td><div id="link$<%= i %>" class="edit"><%= oXMLItems.item(i).getAttribute("link") %></div></td>
<td><div id="itemtitle$<%= i %>" class="edit"><%= oXMLItems.item(i).getAttribute("itemtitle") %></div></td>
<td><a href="javascript://" class="delete" index="<%= i %>">删除</a></td>
</tr>




<%
Next
%>

<tr>
<td><input type="text" name="item_url" id="item_url" /></td>
<td><input type="text" name="link" id="link" /></td>
<td><input type="text" name="itemtitle" id="itemtitle" /></td>
<td><input type="submit" name="AddNew" id="AddNew" value="Submit" /></td>
</tr>

</table>
<script type="text/javascript">


$(function(){

jQuery('.edit').editable("?WebMethod=edit", {width:120,submit : "保存", cancel : "取消",
/*onblur: 'submit',*/indicator : "正在更新...",tooltip : '单击进行编辑.'}, function(){/*update succeed*/});

jQuery('.delete').click(function(){

me = $(this);

$.post("?WebMethod=delete&index=" + me.attr("index"), function(d){
me.parent().parent().css({display:'none'});

});

});

});


</script>
</form>
</body>
</html>

Set oXMLItems = oXMLRoot.selectNodes("//item")第9行缺少对象怎么解决
搜索更多相关主题的帖子: selectNodes oXMLItems oXMLRoot item Set 
2009-11-30 16:28



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-293496-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.685409 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved