Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to pass xml data in Jquery

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 259
    Comment on it

    Hello Reader's!, If you have given a xml data and you need to parse it into Jquery, Then you can use the parseXML function. Let's see the example below:-

    var xml='<Pages><Page Name="test"><controls><test>parsing into jquery.</test></controls></Page> 
    <Page Name = "User">
    <controls><name>findnerd</name>
    </controls></page></Pages>';
        xmlDoc = $.parseXML( xml ),
        $xml = $( xmlDoc ); 
    
        $($xml).each(function(){
        alert($(this).find("Page[Name]>controls>name").text());
        });
    

    Now it'll alert the name 'Findnerd ' which will come from Jquery

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: