这是一个在客户端生成并使用XML的例子,主要用途实现无双刷新页面在客户端处理复杂的数据,由两个文件构成。大家可以看一下,提出宝贵的意见。注意:使用时将saveXML.asp的路径改为GenXML.html的物理路径
-GenXML.html-
<!--
*******
'* Author hardvb
'* Support : web@mb5u.com
'* Date Created : 2004/6/18 Merry ChrisMas Day
'* Date Modified:
'* Function: genrate XML Tree and Show in Client
'********
-->
<html>
<head>
<title>
Item Information
</title>
</head>
<body>
<H2>A example genrate XML Tree with JavaScript
<br>
<div id=addItem name=addItem></div> <!--the DIV use for add Item-->
<form name=formItem action="processForm.asp" method="post">
<TABLE WIDTH="60%" BORDER="2" bordercolor="orange" CELLSPACING="1" CELLPADDING="1">
<tr>
<td colspan=2><h3>Enter your Item information</h3></td>
</tr>
<tr>
<td>Item Name:</td>
<td><input type="text" name="ItemName"></td>
<tr>
<tr>
<td>Mount: </td>
<td> <input type="text" name="Mount"></td>
</tr>
<tr>
<td> Spec: </td>
<td> <input type="text" name="Spec"></td>
</tr>
<tr>
<td> price:</td>
<td><input type="text" name="price"></td>
</tr>
<tr>
<td align=center colspan=2>
<input type="button" id="btnSub" name="btnSub" value="Add" onclick="add();">
<input type="button" id="btndel" name="btndel" value="Del" onclick="Del(document.all.delNo.value);">
Del No : <input type="text" size=3 name="delNo">
<input type="button" size=3 onclick="ListItem();" value="ReList All Item": >
</td>
</tr>
</TABLE>
</form>
<input type="button" id="lookXML" name="lookXML" value="look XML" onclick="window.open('EPR.xml','XML','toolbar=no,status=no,scrollbars=yes, height=400,width=500,top=50,left=30');"><br>
</body>
</html>
新闻热点
疑难解答