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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With