Reputation: 21371
Here's a snapshot of my HTML code as viewed after clicking View Source in IE9. I opens up in Notepad++
Here is the code as parsed by the IE9's Developer Tool:
Why is there a disconnect between the two?
Upvotes: 1
Views: 1079
Reputation: 201538
As @Shadow Wizard suggested in a comment, the probable cause is some data character before the <!DOCTYPE ...>
declaration. For example, the problem is reproducible by taking a valid XHTML document and inserting the no-break space character (NBSP, U+00A0) at the very start of the document. But the presence of a BOM at the start does not cause the problem (at least not on IE 9, hardly on any browser in use). There is a large number of invisible or barely visible characters that might cause the problem.
Upvotes: 1
Reputation: 11245
The Developer Tool does NOT show you the source of your code, it shows the DOM (Document Object Model) that's why there are differences. You can read more about DOM here: https://developer.mozilla.org/en/DOM/
The content showed in Developer Tool represents your parsed Source with some modifications to be more readable and without incorrect tags, in two words it does not show the exact source.
Upvotes: 1