</body> </HTML> //xml数据岛中添加记录 ------------------------------- The following list is a sample of the properties and methods that you use to access nodes in an XML
document. Property/ Method Description XMLDocument Returns a reference to the XML Document Object Model (DOM) exposed by the object. documentElement Returns the document root of the XML document. childNodes Returns a node list containing the children of a node (if any). item Accesses individual nodes within the list through an index. Index values are zero-based, so item(0) returns the first child node. text Returns the text content of the node. The following code shows an HTML page containing an XML data island. The data island is contained within the <XML> element. <HTML> <HEAD> <TITLE>HTML with XML Data Island</TITLE> </HEAD> <BODY> <P>Within this document is an XML data island.</P> <XML ID="resortXML"> <resorts> <resort code='1'>Adventure Works</resort> <resort>Alpine Ski House</resort> </resorts> </XML> </BODY> </HTML> For an example, you can cut and paste this sample line of code: resortXML.XMLDocument.documentElement.childNodes.item(1).text//读取页面上的XML数据岛中的数据 resortXML.documentElement.childNodes.item(0).getAttribute("code")//读取页面上的XML数据岛中的数据 resortXML.documentElement.childNodes[0].getAttribute("code")//读取页面上的XML数据岛中的数据 199.模式窗口 父窗口 var url="aaa.jsp"; var data=showModalDialog(url,null,"dialogHeight:400px;dialogHeight:600px;center:yes;help:No;status:no;resizab le:Yes;edge:sunken"); if(data) alert(data.value); 子窗口 var data=new Object(); data.value1="china"; window.returnValue=data; window.close(); |