The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Browser Independence, Writing for browser Independence
Rating  5
t-a-g
post Sep 6 2006, 11:45 AM
Post #1


Newbie
*

Group: Members
Posts: 11
Joined: 6-September 06
Member No.: 78



Does anyone have any guidelines to offer on how to write browser independent HTML, and javascript code?

Any good books to suggest?
Good web sites or other resources to offer?

What DTD should I start with?
Is
DTD "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"

better or easier than
DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

How can I find out what javascript will work on MAC Safari & Firefox BUT also work on IE and Firefox for the PC?

I would really appreciate the help.


Thank you,
-tag noob
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Sep 6 2006, 12:50 PM
Post #2


.
********

Group: WDG Moderators
Posts: 6,008
Joined: 10-August 06
Member No.: 7



QUOTE(t-a-g @ Sep 6 2006, 06:45 PM) *

Does anyone have any guidelines to offer on how to write browser independent HTML, and javascript code?


For HTML the important thing is to make it validate. Use any of these tools:
http://htmlhelp.com/tools/validator/
http://validator.w3.org/

Also, check that the HTML elements are supported or at least degrade gracefully. See http://www.blooberry.com/indexdot/html/tagindex/all.htm

CSS is usually more bug-prone and less supported than HTML, so see also
http://www.blooberry.com/indexdot/css/propindex/all.htm and http://jigsaw.w3.org/css-validator/

Here's Microsoft's HTML, CSS and DHTML reference for IE/Win: http://msdn.microsoft.com/library/default....rence_entry.asp

Note that web pages should not rely on neither CSS, Javascript or even HTML(!), e.g. some browsers may not support HTML tables, and search engines ignore CSS and much of javascript. Compare http://www.cs.tut.fi/~jkorpela/html/augm.html

QUOTE

What DTD should I start with?
Is
DTD "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"

better or easier than
DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


Browsers will normally not notice the difference between XHTML or HTML, I recommend HTML4 Strict, see http://www.htmlhelp.com/tools/validator/doctype.html since HTML4 is much simpler and XHTML is mostly hype with no real advantages.

For especially CSS it's important wether the Doctype puts the browser in quirks- or standards mode. I recommend standards mode, see http://hsivonen.iki.fi/doctype/

QUOTE

How can I find out what javascript will work on MAC Safari & Firefox BUT also work on IE and Firefox for the PC?


This site is very useful: http://www.quirksmode.org/ especially http://www.quirksmode.org/js/support.html and http://www.quirksmode.org/dom/w3c_core.html

AFAIK Mozilla/Firefox' rendering engine (Gecko) is the same on all platforms. IE/Win and IE/Mac are not the same. Not sure about Opera.

It's best to test continuously in all the major browsers from the start, rather than making a whole site in say Firefox and only test in IE afterwards.

If you don't have access to a particular browser a screen capture service might help: http://www.google.com/search?q=browser+screen+capture however this can be tricky with DHTML that requires user interaction.


--------------------
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
t-a-g
post Sep 7 2006, 11:22 AM
Post #3


Newbie
*

Group: Members
Posts: 11
Joined: 6-September 06
Member No.: 78



Thank you for all of the info.

-tag
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 1st September 2014 - 01:38 PM