jQuery .html() not displaying any data in ie7, but ie8 works jQuery .html() not displaying any data in ie7, but ie8 works wordpress wordpress

jQuery .html() not displaying any data in ie7, but ie8 works


.html() method uses the browser's innerHTML property.Some browsers may not generate a DOM that exactly replicates the HTML source provided.

It seems that jQuery html() method calls the method empty() on an existing DOM object. Hence try empty() instead of html() on the div, and try append(). For example

 $('#vehicle-alt').append('html content');

Also please try other dom manipulation menthods provided from JQuery.


I had this bug too.

The solution is to validate the html content that I was trying to print or add.

I tried several jquery functions: html, append, appendTo... But nothing worked.

In my case the html had an extra close tag. I deleted it and now everything is working ok.


I had this bug when there was two or more elements with the same ID. It occured only in IE7.

The fix was of course to make sure that each element had a unique ID.