jquery .html() does not work on ie8

后端 未结 7 599
耶瑟儿~
耶瑟儿~ 2021-02-04 05:48

I have a jquery function which makes an ajax call to a webservice method on the web server, the method returns a html table with data. I am using .html() to render the return va

7条回答
  •  借酒劲吻你
    2021-02-04 05:54

    It seems IE8 has problems inserting long strings of text with jQuery's html(), making the div's content just completely blank. Just tried it with both a very long string and one containing just 'blah', and that made all the difference.

    So if you're expecting very large chucks of text (like 2k+ characters), go for the native innerHTML. Didn't do any further research, so I don't know what's the max length of a string to be passed through html() in IE8.

提交回复
热议问题