How to use jquery get content with tags in xml -
first have xml :
<app id="id-1"> <html_code> <div id="id-1" class="portlet"> <div class="portlet-header">links</div> <div class="portlet-content">id-1</div> </div> </html_code> </app> i want use jquery $.ajax content in tags use
$.ajax({ …… success: function (xml) { alert($(xml).find("app[id='id-1']").find("html_code").text()); } }); however, alert "links","id-1",but want <html_code>'s content include <div> tags,
so how can achieve use jquery ?or should javascript use "getxml"……
thank you:)
you need use .html() instead of .text() raw unfiltered goodness, this:
alert($(xml).find("app[id='id-1']").find("html_code").html());
Comments
Post a Comment