Error: Invalid source HTML for this operation
Categories: HTML, Internet Explorer, JavaScript, Mozilla
Tags: HTML, Internet Explorer, JavaScript
Written By: admin
Hi developers, today I encountered one error which works fine in Mozilla Firefox but giving an error in IE (Internet Explorer). In IE, the error which I encountered is “Error: Invalid source HTML for this operation “, when I run the same application in Firefox, it renders properly without any warnings or errors in the JavaScript console.
I wondered why IE will raise an issue when I could not see any error in Firefox? annoying error right? Yes! same thing I feel.
After searching a lot in Google by this query “Error: Invalid source HTML for this operation“, I got the answer by seeing some forums. This Error might be because of “Inserting a block element inside a non-block element”
like for example: document.getElementById(’inserting’).innerHTML=”<span><div>Inserting a block element inside a non-block element</div></span>”
The above is strictly not allowed in IE6.0 browsers. When you render the same in IE browser will raise an error saying the same “Error: Invalid source HTML for this operation“, when you render the same in Firefox browsers then will render properly without any error
You can view the below links for reference:
innerHTML and non-block elements
http://xinha.webfactional.com/ticket/129
Related Topics which you would like to read:
1. System Error: -1072896658 in IE
2. Snippet Code for Simple Ajax Tabs with cool CSS Styles
3. Using XMLHttpRequest, reading XML data (Adobe AIR Application)
4. Remove special characters (like !, >, ?, ., # etc.,) from a string using JavaScript
5. 10 different styles of Accordions (Using Ajax, JavaScript, DHTML)








September 1st, 2008 at 6:50 pm
[...] Original post by admin [...]
September 1st, 2008 at 6:53 pm
[...] Original post by admin [...]
October 27th, 2008 at 3:49 pm
[...] Browser Detection Code Snippet 4. Netscape is the ‘navigator.appName’ for Google Chrome 5. Error: Invalid source HTML for this operation 6. System Error: -1072896658 in [...]
November 2nd, 2008 at 5:41 am
[...] Detection Code Snippet 7. Netscape is the ‘navigator.appName’ for Google Chrome 8. Error: Invalid source HTML for this operation 9. System Error: -1072896658 in IE 10. Simple steps to develop AJAX Website – [...]