jquery .html() does not work on ie8

后端 未结 7 598
耶瑟儿~
耶瑟儿~ 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 06:14

    I know it's bit of a late answer; but you could also fix it with a try/catch block. Sometimes you might not have all the control over the content.

    This way you keep the original code working for the new browsers, while the catch runs the innerHTML for IE8.

    try {
        //new browsers
        $('#dvProudctInstruction').html(data.d[1]);
    } catch (e) {
        //IE8
        $('#dvProudctInstruction').innerHTML = data.d[1];
    }
    

    Hope this helps someone!

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