jquery .text doesn't render HTML elements into the DOM

前端 未结 3 1246
故里飘歌
故里飘歌 2020-12-12 07:47

I am loading a list of images into a div with the following bit of jQuery :

                var jewellerDdl = \"<%= JewellerDropDownList.ClientID %>\";         


        
相关标签:
3条回答
  • 2020-12-12 07:58

    Try this instead:

    $("#divEntryDisplay").html(result.d);
    
    0 讨论(0)
  • 2020-12-12 07:59

    You should indeed use the html method (cf. documentation here : http://docs.jquery.com/Attributes/html)

    Which makes your function look like this:

     function AjaxSucceeded(result) {
        $("#divEntryDisplay").html(result.d);
     }
    
    0 讨论(0)
  • 2020-12-12 08:02

    If you insert HTML code into the DOM, then you must use the html() method, not the text() method.

    0 讨论(0)
提交回复
热议问题