开发者

Unable to output formatted HTML from Jquery with html DataType

开发者 https://www.devze.com 2022-12-27 07:42 出处:网络
I am calling some data which has pre-formatted HTML code in it, but when it renders from the jquery it appears to ignore my markup. This is my jQuery:

I am calling some data which has pre-formatted HTML code in it, but when it renders from the jquery it appears to ignore my markup. This is my jQuery:

function GetFeed(){
   document.getElementById("marq").innerHTML = '';

   $.ajax({
    type: "POST",
    url: "xmlproxy.ashx",    
    dataType: "html",
    success: function(obj) {        
     开发者_Go百科  $('<span class="tickerItem"></span>').html(obj).appendTo('#marq');
    }
   });
}


Your selector is wrong just do:

$("#marq").append(your_html);
0

精彩评论

暂无评论...
验证码 换一张
取 消