Cross-browser
Cross-browser refers to the ability for a website, web application, HTML construct or client-side script to support all the web browsers. The term cross-browser is often confused with multi-browser. Multi-browser means something works with several web browsers. Cross-browser means something works with all versions of all browsers to have existed since the web began.
The term was widely used during the browser wars in late-1990s. In that context, the term referred to websites and code snippets that worked in both Internet Explorer and Netscape Navigator. During the browser wars, new features were added to browsers without any coordination between vendors. Thus it often happened that though both browsers supported some particular feature, there were differences in the way the feature worked, ranging from slight cosmetic issues to profound conceptual differences.
The term is still in use, but to lesser extent. The main reasons for this are:
- Later versions of both Internet Explorer and Netscape included support for HTML 4.0 and CSS1, proprietary extensions were no longer required to accomplish many commonly desired designs.
- Somewhat more compatible DOM manipulation techniques became the preferred method for writing client-side scripts.
- The browser market has broadened, and to claim cross-browser compatibility, the website is nowadays expected to support browsers such as Mozilla Firefox, Opera, and Safari in addition to Internet Explorer and Netscape.
- There has been an attitude shift towards more compatibility in general. Thus, some degree of cross-browser support is expected and only its absence needs to be noted.
Example of cross-browser coding
To follow this example, you must have basic knowledge of HTML and JavaScript. Consider this snippet of HTML code:
<div id="sample" style="position: absolute; top: 100px; left: 100px;">some text</div>
The code describes a block of text, which should be displayed 100 pixels from the top and to the right from the top-left corner of the browser window. In a Netscape Navigator 4 -series browser, you would move it right with the following JavaScript code:
document.layers['sample'].left = 200;
However, to accomplish the same thing in Internet Explorer 4 you need to do this:
document.all['sample'].style.left = 200;
In order for the code to work in both browsers and thus be cross-browser compatible, it could be written like this:
if (document.all) document.all['sample'].style.left = 200;else if (document.layers) document.layers['sample'].left = 200;
The following code that uses W3C standard DOM method works in Mozilla browsers, recent versions of Internet Explorer and various other recent browsers that comply with the W3C standard:
document.getElementById('sample').style.left = '200px';





Sites we Like……
[...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]……
Websites worth visiting…
[...]here are some links to sites that we link to because we think they are worth visiting[...]……
Wholesale Yankee Candles…
[...]just below, are some totally unrelated sites to ours, however, they are definitely worth checking out[...]…
Discount Yankee Candles…
[...]while the sites we link to below are completely unrelated to ours, we think they are worth a read, so have a look[...]…
Cheap Yankee Candles…
[...]here are some links to sites that we link to because we think they are worth visiting[...]…
TV Lamps…
The Truth behind Television Replacement Lamps….
adult social network…
[...]below you’ll find the link to some sites that we think you should visit[...]…
Found=> Mentions You…
[...]we came upon a terrific site that you might enjoy. Examine in case you want[...]…
Sites we Like……
[...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]……
Related……
[...]just beneath, are numerous totally not related sites to ours, however, they are surely worth going over[...]……
Buy Yankee Candles Cheap…
[...]below you’ll find the link to some sites that we think you should visit[...]…
Great Clips Coupons…
[...]these are several listings to internet pages that we link to since we believe these are definitely worth visiting[...]…
Sites we Like……
[...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]……
Found=> recommends your website…
[...]These are a handful of featured websites that manу of uѕ choose tо honor that hаs a link here we аre аt thеіr site[...]…
Can I buy a vowel…
I haven’t a clue about this topic. None of it made sense to me….
Blogs ou should be reading…
[...]Here is a Great Blog You Might Find Interesting that we Encourage You[...]……
Cool sites…
[...]we came across a cool site that you might enjoy. Take a look if you want[...]……
buy damansara house…
[...]you will find information that’s relevant to you if you want to buy damansara house[...]…
Sites we Like……
[...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]……
Read was interesting, stay in touch……
[...]please visit the sites we follow, including this one, as it represents our picks from the web[...]……
You should check this out…
[...] Wonderful story, reckoned we could combine a few unrelated data, nevertheless really worth taking a look, whoa did one learn about Mid East has got more problerms as well [...]……
Angry Birds Online…
[...]listed below are a few listings to web sites I always connect to since we believe they will be definitely worth browsing[...]…
Recommended websites……
[...]take time to learn or check out the content of these sites we’ve linked to below[...]……
Garmin 1490t Best Price…
[...]while the sites we link to below are completely unrelated to ours, we think they are worth a read, so have a look[...]…
Looking around…
I like to look in various places on the internet, often I will just go to Stumble Upon and read and check stuff out…
Finally…
Leading topics to read….
cheap webhosting…
[...]This extremely relates to the topics I was simply writing about[...]…
Gems form the internet……
[...]always a big fan of linking to bloggers that I love[...]……
Dreary Day…
It was a dreary day here today, so I just took to messing around online and found…
Still pondering this one…
Ever mull over where to head out to for a trip and wind up going nowhere but wishing you had….
travel…
[...]the time to read or visit the content or sites we have linked to below the[...]…
Can I buy a vowel…
I have not a clue about this topic. None of it made sense to me….
Yahoo results…
While searching Yahoo I found this page in the results and I didn’t think it fit…
Digg…
While checking out DIGG yesterday I found this…
Summer is here ~ come and cool down with our cool news !…
[...]here are some sites that we think it will cool you down[...]…
Websites…
[...]%BLOGTITLE%[...]…
Could have been better…
Great thought although it is not like John Galliano or is it?…
Websites we think you should visit…
[...]although websites we backlink to below are considerably not related to ours, we feel they are actually worth a go through, so have a look[...]……
Sources…
[...]check below, are some totally unrelated websites to ours, however, they are most trustworthy sources that we use[...]……
Superb website…
[...]always a big fan of linking to bloggers that I love but don’t get a lot of link love from[...]……
[...] Cross-browser | Source and Code [...]
[...] post: Cross-browser | Source and Code Related Posts:Cross-Browser Compatibility Issues | Source and Code This is because different [...]
[...] more: Cross-browser | Source and Code Related Posts:Cross-browser | Source and Code Example of cross-browser coding. To follow this [...]
[...] here to read the rest: Cross-browser | Source and Code Related Posts:Cross-browser | Source and Code Example of cross-browser coding. To follow this [...]
[...] original here: Cross-browser | Source and Code Related Posts:List of Cross-Browser CSS PropertiesPHP Help with cross browser formatting and [...]