XML parsing using jQuery

后端 未结 3 652
孤独总比滥情好
孤独总比滥情好 2021-01-16 12:56

I have the following xml:




        
3条回答
  •  轮回少年
    2021-01-16 13:14

    Try running the code from your browser's console instead of when the document is ready. It will allow you to iterate on things much quicker. Try FireBug in Firefox for starters. I find the FB console to be much easier to use when debugging complex actions than what you get in a Webkit based browser.

    You might also try adding error and complete callback functions to your $.ajax() call.

    $.ajax({
        // ...
        error: function (req, err_type, ex) { console.log("error..."); },
        complete: function (req, status) { console.log("complete..."); }
    });
    

    You can also try tossing in some alerts or console.logs inside your success handler. Just enough to make sure you know it is being called and is getting the xml result that you expect it to get.

提交回复
热议问题