Today I was stucked with strange bug, the content of div showed nothing in IE when I tried to populate it with Ajax result. After I spent 20 minutes (or perhaps more ) of JavaScript debugging, I noticed that nothing wrong with that part of script, even I added exception handling though it wasn’t neccesary.

Somehow I just realized that the Ajax result contains form tag. This bring back old memories, I experienced similar problem long time ago. I ensured that this was the problem via googling.

The solution is creating other element (I use div), and populate the Ajax result inside that new element, then attach the newly created element to existing container.

var div = document.createElement('div'); 
div.innerHTML = ajaxResult;

While the solution is really simple, this is enough to annoy me.