Differences in Internet Explorer and FireFox CSS and Javascript

I've done quite a few web UI changes, including CSS styles and javascript testing in IE. Now I have to  ensure, that it also work in FioreFox.
The suggested  Collection of Global CSS Reset Styles not always work , if site has already some default style settings.
I also incorrectly used parentElement in DOM - always use parentNode instead.
innerText
Thanks to Damian Edwards who pointed another FireFox incompatibility bug in our javascript code:
The line in javascript causing the issue easily figured out using Firebug.
 The elem.innerText property is an IE proprietary addition and thus not usually supported by other browsers. Instead you should be getting the “inner text” of the cell using something like the following:

elem.firstChild.nodeValue;

This uses W3C DOM compliant properties to retrieve the text value of the first TextNode of the cell. This makes it more likely to work across browsers.

 
Width in IE and Firefox   treated differently.
According to standard (that FireFox follows), content width is set excluding paddings and border(see figure there).
"The size of the box is the sum of the element width (i.e. formatted text or image) and the padding, the border and the margin areas".

But in IE the width of the box is the width of the content plus any border or padding.
In other words:
width(IE)="padding-left"+"border-left"+ width(FF) + "padding-right"+"border--right".
To make IE to follow standard can be done by specifying
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
or
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
Unfortunately, this change will have MAJOR impact on existing web site. In our application we effectively have one page with different user controls loaded dynamically, so the change will effect everything -too risky.
Class and ID Names are Case Sensitive in FireFox
IE is not case sensitive, when you search by ID.  If your  script is working in IE, but not if FF, check that the IDs are written consistently.
More tips can be found in Adrian Anttila's post JavaScript differences in Firefox and Internet Explorer  
Different Tools.
For IE I mentioned some tools in my older post Tools to debug/Trace ASP.NET applications.

How to detect Debug mode in JavaScript

I've asked a question on forum:

AJAX ScriptManager Class  has a IsDebuggingEnabled property, that is available in server code. I want in my client Javascript function to determine, do I running debug or release mode.

MS Online Community Support suggested :

You can create a hidden field to the page, then, check the IsDebuggingEnabled property of ScriptManager , if it is true, set the value of the hidden field to "true", else, false.

It will work, but I expected the method available in some AJAX client library class.

Declare different CSS rules for Firefox and Internet Explorer 7

The post Creating different CSS style selector definitions for different browsers (Firefox, Internet Explorer 7 and IE 6.0) with subsequent comments describes that
You can have the same attribute for different browsers in the same rule by specifying # and _ prefix
.context_bar_form_field
{
height: 15px;/* apply to all browsers */
#height: 15px;/
* override for Microsoft Internet Explorer browsers*/
_height: 21px; ;/* override for IE browsers 6.0 and older */
}
<!--[if gt IE 5]>
<style type="text/css" media="screen">
.idonnyCSS{font-size: 1.3em }
/*The above CSS definitions will only be applies to IE versions greater than 5*/
</style>
<![endif]-->

I prefer the first opton for small changes to keep all definitions for the class/selector in one place.

CSS Filters chart describes "Will the browser apply the rule(s)?".


More discussion are in
http://24ways.org/2005/avoiding-css-hacks-for-internet-explorer

«February»
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
2425262728291
2345678