Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery.html() is not working in IE7 but innerHTML working on same place [closed]

I implemented one functionality where div is populating via ajax response, check below code for more clarity:

jQuery.ajax({
    type: 'POST',
    url: url,
    dataType: 'json',
    data:data,
    success: function(jsonResp) {
        $('#formContainer').html(jsonResp.html);
    }
});

jquery .html() function is working in FF,crome,IE 8,9 but not working in IE7 as expected it's not populating given html response, I did some debug in the code & checked whether is there any other div with same ID or not but there is only one div in the document who have 'formContainer' ID, after that when i use innerHTML function instead of $.html() function,it's working correctly in IE7, I am not able to figure out why innerHTML is working & $.html() not.

If there is any major cause i need to replace $().html() function by innerHTML function across the application.

like image 732
sarvesh Avatar asked Nov 03 '22 08:11

sarvesh


1 Answers

jQuery html attribute not working in IE

This link provides umpteen ways of doing the same. We had the same issue, and found a way out using this.

like image 142
LPD Avatar answered Nov 08 '22 05:11

LPD