Cross-browser compatibility (Definition)

Different browsers have different features and capabilities.

The differences between browsers are most acute when considering Netscape vs. MSIE. The Opera and iCab browsers are keen to become ECMAScript-compliant. Recent versions of MSIE also make this claim and it is likely that imminent versions of Netscape will be at least as ECMAScript-compliant as the other browsers. This bodes well for the future in that we can code for a base level of functionality and be able to deploy a useful sub-set of the JavaScript capabilities of each browser.

Inevitably, they will continue to present features that are browser specific. Some of those will be accommodated in the next revision of the ECMA standard. But some won't.

You may find that your script needs to do something more esoteric than a simple form validation or mouse rollover. In particular doing any dynamic HTML and changing <DIV>, <SPAN>, or <LAYER> content. For these kinds of things, you may need to use browser-detection scripts and then provide alternative versions of some of your functions so that you select one that is appropriate for the browser the script happens to find itself running in.

See also:Compatibility, Defensive coding