Home >> Computers >> Programming >> Internet >> DHTML >> Cross-Browser APIs




Cross-web browser refers to the ability for the website, web application, HTML construct or client-side script to support multiple web browsers.

A term was widely utilized when you took a browser wars in late-90s. Thereinside context, a term referred to websites & code snipping that worked in each Internet Explorer and Netscape Navigator. In a period of the web browser wars, newly features were added to browsers forgoing any coordination between seller. So it typically happened that though each browsers supported occasionally particular feature, there were differences in a way the feature worked, ranging from either cold-shoulder cosmetic issues to profound conceptual differences.

A term is however inside apply (as of 2005), but to lesser extent. A independent reasons for this come: Late versions of each Internet Explorer & Netscape involved trend lines for HTML Four.Nought & CSS1, proprietary extensions were there is no yearn expected to accomplish several normally desired designs. Somewhat other compatible DOM manipulation techniques became the favorite method for writing client-side scripts. A web web browser market has broadened, & to claim cross-browser compatibility, a internet site is present potential to trend lines browsers like Opera and Safari in addition to Internet Explorer and Netscape. There has been an attitude shift towards other compatibility generally. So, a select few degree of cross-web browser trend lines is required & single its absence needs to exist as noted.

Example of cross-browser coding

To watch this case, you may require basic cognition of HTML & JavaScript. Assume this snipping of HTML code:

<div id="sample" style="position : absolute; top : 100px; left : 100px;">occasionally text</div>

a code describes a prevent of text, which should exist as displayed Century pixels from either either a top & to the left from the top-left corner of the web browser window. Inside a Netscape Navigator Four -series web browser, busy people would move it correct using the as punishment JavaScript code:

document.shells['sample'].left = 200;

Notwithstanding, to accomplish a equivalent tool Internet Explorer Four that you require to run this:

document.everthing['sample'].style.left = 200;

Sequentially for the code to function within each browsers & so exist as cross-web browser compatible, it needs to written such as this:

whenever (document.everthing) document.a lot['sample'].style.left = 200; else in case (document.shells) document.shells['sample'].left = 200;

A ensuing code that utilizes W3C standard DOM method works in Mozilla browsers, recent versions of Internet Explorer and various other recent browsers that comply to the W3C standard:

document.getElementById('sample').style.left = '200px';

gmL Module
Server-side component for generating JavaScript-based DHTML, available as a PHP module or a C++ program.


Computers: Programming: Internet: Server Side Scripting






© 2005 GeneralAnswers.org