0

I'm trying to parse a little bit of XML with JQuery, I'd like to find the entries with updated status of 0 and add them to one array and do the same for updated statuses of 1 to a different array.

XML:

<entries>
   <upd>
      <updated>0</updated>
      <name>Adams</name>
   </upd>

   <upd>
      <updated>1</updated>
      <name>Dempsey</name>
   </upd>
</entries>

All I have as of right now is:

        $(xml).find("upd").each(function(){

        });

My main problem is distinguishing between an updated status of 1 or 0.

1 Answer 1

2
$(xml).find("upd").each(function() {
    var updated = $(this).find("updated").text();
    console.log(updated); // 0 then 1
});

Continue down the same path. Example

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.