Browser Independent Pages

One of the most important (and a bit difficult) aspects I faced during the development was that, I was given a task to refine the code of an existing web application in a way that it should be browser independent. The site was currently facing problems due to frequent use of broken HTML tags as well as use of Frames and some HTML tags which are not supported in other browser thank IE (Internet Explorer). Initially the end-user were few and were using only IE, but with the passage to time when the number of users increased, this became necessity, because many important users had MAC OS. MAC supports Mozilla Fire fox, an older version of IE and Netscape etc. That led me to work a bit harder and during the development I gathered certain guideline which I find important to be shared with other developers if they do not already know it.

Browser Independent Web Pages

In order to achieve this, following guidelines should be followed.
 

1.      Try to keep most of the application logic on the server side. 

2.      Make sure that there are not broken HTML tags. IE normally accepts the broken tags but not all browsers such as Mozilla, Netscape etc.

3.      If you face such situation where you need some specific input mechanism which cannot be compromised due to browsers then, prefer doing a server side scripting to find out what browser is requesting the page and then appropriately re-direct the browser to browser specific page. This although doubles the work, but in certain situations this was the choice of many developers. 

4.      Include the HEIGHT, and WIDTH attributes with the < image > tag, because some browsers format the page with text first and then add the graphics later. If you don't specify the HEIGHT and WIDTH attributes, then the pages could end up with annoying results. Also use the ALT attribute with the images displayed. 

5.      Avoid using names for the colours i.e. bgcolor="red", instead, prefer using hexadecimal codes i.e. bgcolor="#ff0000" etc. 

6.      Avoid using frames and try to accomplish the same functionality through some generic HTML features such as tables. The reason is that some browsers such as Netscape do not support Frame. 

7.      Html special code should be in small letters, like &amp; &lt; &gt; etc. otherwise Netscape will not be able to interpret correctly. 

8.      Font tag should be without FACE and COLOR attributes and should be with simple styles

cheers !

Published Wednesday, July 18, 2007 4:11 AM by Raheel Hussain

Comments

No Comments
Powered by Community Server (Non-Commercial Edition), by Telligent Systems