I am grabbing some XML from our server, then writing that out with
<li> tags in the browser, all using the jquery .ajax() function.

By design, our server wraps items with a parent of the same name,
like:

<test>
<test id="1">test 1</test>
<test id="2">test 2</test>
</test>

Because my function checks for each test tag, it finds the first
parent, but returns undefined, since it does not have any attributes.
Is it possible to ignore this first result, and start with the second
item, which will correctly have attributes?

success: function(xml) {
                     $(xml).find('testt').each(function() {
                         var id_text = $(this).attr('id')
                         var id_name = $(this).attr('name')
                         $('<li></li>').html('id_code + ' - ' +
id_text).appendTo('#test');
                     });
                }

Reply via email to