Getting HTML from XML with JavaScript/jQuery

后端 未结 2 1134
星月不相逢
星月不相逢 2020-12-21 16:01

I\'ve got an XML document that contains a tag that has well-formed HTML content. I need to get that HTML into my page using JavaScript. However, due to CMS issues, the HTML

2条回答
  •  粉色の甜心
    2020-12-21 16:28

    @Sam Nicholson gave us a good idea. I used it for a while, but now i solved my problem through another way.

    By setting AJAX property 'dataType' to 'html' and forcing the server response to be text/html rather than text/xml. jQuery will let you use .html() to manipulate the nodes of your XML tree sent from your server

提交回复
热议问题