C#,vb.net,MVC,Jquery,javascript,jscript,vbscript,html,vb,sharepoint,COM,WPF,WCF,Wwf,Asp,Asp.net,questions & answers,

Latest in Sports

Wednesday, December 31, 2014

Cross browser compatibility - Well-formed HTML in IE8< vs. IE 9

Cross browser compatibility - Well-formed HTML in IE8< vs. IE 9.
Applies To:
This issue applies to all the browsers that support HTML 5 specification.
Problem: 
Browsers typically detect the well-formed characteristics of XML. But when it comes to html, lots of pre-html5 based browsers used to ignore the tags that are not well formed. In some cases it might not result in a visible issue and might not be very evident as well. Typically when these are opened in Visual studio it will highlight and the catch is when the html is huge or when it is dynamically rendered.
For ex. The business wanted to show a few text in bold, but that was not visible as bold to the users using that. Also the contents of the page beyond the error are not submitted back. Consider the snippet below
...
<table>
<thead>
<tr><td><b>Employee ID<\td><td><b>Employee ID<\b><\td><\tr>
</thead>
</table>
<input type="text" id="txtEmpName"/>
....
<input type="submit" value="Save"/>
....
You can expect issues that the text or other controls below are not part of the request collection. IE9 breaks on all errors and anything beyond the error don’t find a place in the list of values posted back. This might not be the case with IE8< browsers or on IE9 compatibility modes.

Solution:
The solution is to identify all HTML issues and ensure that the HTML is well formed(example: closing tags are present). This applies to Script tags as well.

No comments:

Post a Comment