Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我从 jQuery ajax 获取 xml,发现您可以使用以下内容来显示 xml:
$.ajax.({... ... success: function(xml, textStatus, jqXHR) { $("#mydiv").text(jqXHR.responseText);
是否可以在树结构中显示格式良好的 xml,在 Chrome 或 Firefox 中仅使用 jQuery 和 HTML?
你知道如何?
<!-- HTML --> <pre id="display"></pre> // JS var xmlStr = (new window.XMLSerializer()).serializeToString(xmlNode); document.getElementById('display').innerText = xmlStr;