Error: Invalid source HTML for this operation

Post Pic

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)

Related Entries...

Advertisement

Please let us know your feedback about the article through the comments section below, we want to hear from you about our website. And your comment / advice may help us to serve you better in upcoming articles.

Thank You!
Vivekanand [Founder of DeveloperSnippets]

5 Responses

[...] Original post by admin [...]

[...] Original post by admin [...]

[...] 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 [...]

[...] 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 – [...]

09.01.08

don’t give same ID more than 1 time (don’t repeat same ID) in side a form

Leave Your Response

* Name, Email, Comment are Required