Explore how web pages using scripts

Explore how web pages using scripts are implemented in different browsers. 

 

Web pages are created by using series of client side technologies such as Java scripts that are processed and displayed by web browsers. Web browsers are used to access Web sites and web pages. The web browser attempts to display graphic, forms, tables, formatted text and other page contains. The most popular web browsers are Microsoft Internet Explorer and safari.

There are some of the issues around the use of scripting languages in different browsers. Web designers need to pay attention to the different browsers because different Web browsers support different tags. There is no one single browser supports every tag in use. So the same web page looks different on other different browsers. Even the same browser using on different operating system will display differently. Now days web designers use multiple web browsers and test their pages in a different browser to make sure that every can access the web page from different browsers or different operating system. For example Dream weaver used to create web pages and also it help web designer to test your web pages in as many browsers as possible.

The web developer creates their own interpreter to determine how browsers will execute the code, so the code will be executed differently. In order to execute the same way in every browsers, the code will need to be re-written for the different interpreters each browsers you need to use.

When you using the ‘substr()’ function in internet explorer, if the index number is a negative value, but still internet explorer will know, it is a ‘0’ although it has a negative value. In order to work this function in Internet Explorer the ‘substr()’ function needs to be change to ‘slice()’ function. The ‘substr()’ function ill work in other web browsers such as safari and Google Chrome. Google Chrome usese the V8 JavaScript engine and Firebox uses the Gecko layout engine.

It is important for users to know which browsers your web page is running in, to get information about the browser, use the built in navigator object. There are several navigator related properties that you can use in your web page, appCodeName (This is string property that contains the code name of the browser) appVersion (this is string property contain the version of the browsers), language, MimTypes[], platform[], UserAgent[]. These properties are implemented in different browsers.

Browser detection

Developers have used browser detection browser to provide a consistent experience between browsers. It is one of the most common scripts used on dynamic HTML page. Browser detection directly checks the browser to identify the model and make. Browser detection is capable of finding out which version and browser being used.

The problems of browser detection is that every time a new browser or version comes out to the market, the developer has to rewrite the java scripts code to make sure that the browser is supported. The solution would be to more and more specific information in how a browser labels itself.

A browser detection technique may not accurately identify a given browser. For example, many browsers support the ability to modify the user-agent string. The following sample code, which inappropriately attempts to use browser.

 

Object detection

Developers have used object detection to identify the certain script can discover whether the object can work with a specific browser. In object detection web developer doesn’t need to rewrite the code for every browser you want to support. If an object or property has been changed in new version browsers, the browser will ignore the scripts. It is common to see object detection within Dynamic HTML web page. Commonly developer use it for image roll-over scripts, testing for the image property

‘window.AddEventListener’ which is an event that only supports within Document Object Model compatible browsers. If the browser is not Document Object Model compatible browsers (Internet Explorer), then delvelopr needs to write an alternative code to access. In this sistuations, ‘window.attachEvent’ will required to support the browsers.

 

M.Ilamaran,

South Thames college, UK

Add Comment