hi there,
Pls help me with my issue-
I am not able to search an XML element as and when it holds a prefix.
For instance-
Here’s one instance from the jQuery.parseXML() page.
The just disparity amid the instance and
the code underneath is that I've deployed the element
Though no errors in the browser, however I no results added on to #someElement.
Whats missing here??
Please help
Thanks much!
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<p id="someElement"></p>
<p id="anotherElement"></p>
<script>
var xml = "<rss version='2.0' xmlns:foo='http://foobar.com'><channel>" +
"<foo:title>RSS Title</foo:title></channel></rss>",
xmlDoc = $.parseXML( xml ),
$xml = $( xmlDoc ),
$title = $xml.find( "title" );
/* append "RSS Title" to #someElement */
$( "#someElement" ).append( $title.text() );
/* change the title to "XML Title" */
$title.text( "XML Title" );
/* append "XML Title" to #anotherElement */
$( "#anotherElement" ).append( $title.text() );
</script>
</body>
</html>
40 weeks 4 days ago