0

That´s all, it simply crashes before showing alert number 1:

jQuery.ajax({
                type: "GET",
                url: basePath+'mostrarMenu.do',
                dataType: "html",
                success: parseXml
              });

function parseXml(xml) {
        var menu = jQuery(xml).find("item");
        alert("0");
        menu.each(function(i, value) {
            alert("1");
            var setere = jQuery(value).find("name")[0].innerHTML;
            alert("2");
            if ( setere == '<!--[CDATA[menuDiv]]-->') {
                jQuery('#menuDiv').append(jQuery(value).find("value")[0].innerHTML);
            }
        });

    }

Any help or recommendation would be appreciated, patience with me, I am a zombie at this point of the day.

4

1 回答 1

1

您应该调用$($.parseXML(xmlString))而不是将 XML 解析为 HTML。

于 2012-05-15T19:04:57.653 回答