I am using jquery ajax using text() but any html written in the XML doesn't render?

Posted by Xtian on Stack Overflow See other posts from Stack Overflow or by Xtian
Published on 2010-06-10T19:21:58Z Indexed on 2010/06/10 19:32 UTC
Read the original article Hit count: 190

Filed under:
|
|
|

So I have Jquery Ajax working real nice, but an issue I am having is in my XML if I want to bold a work or Italicize a sentence, if I do it in the XML using HTML tags it will not show up. I am pretty sure it is due to using the .text(). Any suggestions on a work around for this?

$(document).ready(function(){
   $.ajax({
    type: "GET",
    url: "xml/sites.xml",
    dataType: "xml",
    success: function(xml) {
     $(xml).find('site').each(function(){

    $(this).find('desc').each(function(){
       var brief = $(this).find('brief').text();
       var long = $(this).find('long').text();
       var url = $(this).find('url').text();
       $('<div class="brief"></div>').html(brief).appendTo('#link_'+id);

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about Xml