1 line
1.2 KiB
JSON
1 line
1.2 KiB
JSON
{"name":"jQuery.parseXML","type":"method","title":"jQuery.parseXML()","deprecated":null,"removed":null,"desc":"Parses a string into an XML document.","categories":["utilities","version/1.5"],"entries":[{"return":"XMLDocument","signatures":{"added":"1.5","argument":{"desc":"a well-formed XML string to be parsed","name":"data","type":"String"}},"examples":{"desc":"Create a jQuery object using an XML string and obtain the value of the title node.","html":"\n<p id=\"someElement\"></p>\n<p id=\"anotherElement\"></p>\n","code":"\nvar xml = \"<rss version='2.0'><channel><title>RSS Title</title></channel></rss>\",\n xmlDoc = $.parseXML( xml ),\n $xml = $( xmlDoc ),\n $title = $xml.find( \"title\" );\n\n// Append \"RSS Title\" to #someElement\n$( \"#someElement\" ).append( $title.text() );\n\n// Change the title to \"XML Title\"\n$title.text( \"XML Title\" );\n\n// Append \"XML Title\" to #anotherElement\n$( \"#anotherElement\" ).append( $title.text() );\n"},"longdesc":"\n <p><code>jQuery.parseXML</code> uses the native parsing function of the browser to create a valid XML Document. This document can then be passed to <code>jQuery</code> to create a typical jQuery object that can be traversed and manipulated.</p>\n "}]} |