[jQuery] rewriting generic ajax jQuery style

[jQuery] rewriting generic ajax jQuery style

that actually works quite well. I'll also need to parse the item_name from the xml. It may benifit me more to yank the parent element and then spit back out both childNodes... only thing is the second childNode "item_name" will have to be a link. I suppose I could add an "href" attribute using DOM methods or simply just screw around with the html that is output.
How do I reference more than one tag in the xml?
Here is my current working code:
$(document).ready(function() {
$('#resultcontainer').accordion();
                $("dt").click(function(){
                    idsource = $(this).attr("id");
                    $.get("getItems.php", {cat_id: idsource}, function(xml){
                        var xmlDoc = xml.documentElement;
                        var output = '<table><thead><tr><th>Items Available</th></tr></thead><tbody>';            
                        // Create table rows for each record
                        for (var i=0; i < xmlDoc.childNodes.length; i++)
                        {
                            var linkId = xmlDoc.getElementsByTagName('item_id').item(i).firstChild.data;
                            output += '<tr>';
                            output += '<td>'+linkId;
                            output += '<td><a href="itemdetail.php?item_id='+linkId+'" >'+xmlDoc.getElementsByTagName('item_name').item(i).firstChild.data+'</a></td>';
                            output += '</tr>';
                        }
                            output += '</tbody></table>';
                            document.getElementById("itemtable" +idsource).innerHTML = output;
                    });
                })
                });
I'm not unhappy with it, but I'd like to learn more about how I could do this in jQuery... I've rewritten this app so many times... once with PHP returning HTML snips, once with pure DOM (no innerHTML) once with mootools and now I'm really getting in to jQuery.
Thanks!
-Jim
-----Original Message-----
From: discuss-bounces@jquery.com [mailto:discuss-bounces@jquery.com]On
Behalf Of Sam Collett
Sent: Tuesday, March 06, 2007 10:02 AM
To: jQuery Discussion.
Subject: Re: [jQuery] rewriting generic ajax jQuery style