| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 908 人关注过本帖
标题: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
快速回复:Set oXMLItems = oXMLRoot.selectNodes("//item")第9行缺少对象怎么解 ...
数据加载中...
 
   



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

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