• YouTube
  • LinkedIn
  • Google

Archives for : jQuery

jQuery.html() doesn't work in Internet Explorer

I recently had problems with a javascript code that uses jQuery and it worked in several browsers i.e. Chrome, o Firefox and some versions of Internet Explorer, but that stubbornly refused to work in Internet Explorer 7 and 8.
Here is the code:

After some tests I realized that wasn't a problem in the method, as in other codes it behaved as expected.
So debugging code thoroughly and the answers of the Ajax method realized a small syntax error in HTML and was just correct it and IE 7 displayed correctly the answer.
Then follows the big tip, If you have problems with the method jQuery.html(), check first of all whether the content being written in the element is an html code without errors, because the validation in IE 7/8 will not allow write HTML with errors, no matter how small it is.