Thread: XML AND JQUERY
View Single Post
  #4 (permalink)  
Old July 9th, 2009, 02:42 AM
samjudson's Avatar
samjudson samjudson is offline
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Well you didn't actually list what you where expecting, so there is little surprise my example didn't produce it.

Code:
$(document).ready(function() {
    $.get("labels.xml", function(xml) {
        var nodes= $("name", xml);
        var names = $("<names/>");

        $(nodes).each(function() {
            names.append("<name>" + $(this).text() + "</name>");
        });
                 
        $("div#xml").append(names);
    });
});
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
Reply With Quote
The Following User Says Thank You to samjudson For This Useful Post:
pallone (July 9th, 2009)