jquery, loop xml

ITsolutionWizard
ITsolutionWizard used Ask the Experts™
on
below codings are working fine but I want to loop the xml child nodes instead of the hard codes.

e.g. i have two items below

               var bondState = $event.find("GeneralInformation").find('State').text();
                var bondName = $event.find("GeneralInformation").find('Name').text();

Is it possible to do something like /node then run for loop to get the children nodes?

Thanks

function fnGetBondNameList() {
    var thisTable = $("#table1").dataTable();
    var selecthtml = '';    
    $.ajax({
        url: "http://localhost:5489/BondList.xml",
        // data: data,
        //type: "POST",
        success: function (response) {
            var $events = $(response).find("Bond");
            $events.each(function (index, event) {
                var $event = $(event),
                addData = [];              
                var bondState = $event.find("GeneralInformation").find('State').text();
                var bondName = $event.find("GeneralInformation").find('Name').text();
                addData.push(bondName);
                addData.push(bondState);
                var line = '<button onclick="funDisplayBondInformation(' + "'" + bondState + "'" + "," + "'" + bondName + "'" + ')" id="btnSubmitSelectedBond" name="btnSubmitSelectedBond" class="btn btn-primary btn-xs">Select</button>';
                addData.push(line);
                thisTable.fnAddData(addData);
            });
         }
    });
}
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
Help?
I re-coded another way and it is now resolved the issue

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial