writing for browser compatability

T

Thad

Having been out of the programming picture for a while, things have changed
quite a bit. I want to write a neat and fancy html page but many things
confuse me due to a the incompatibilities. Using only html seems so boring,
though CSS helps a bit. I'm trying to use an external JavaScript program to
show my side menu which links to my other pages depending on which product
they want to look at. Would it be better to write the external code in some
other language so that all browsers can see it or will it always be hit and
miss depending on the users browser? What got me wondering this is the fact
that users can turn off the JavaScript capability.

Thanks,
Thad
 
D

dorayme

"Thad said:
Having been out of the programming picture for a while, things have changed
quite a bit. I want to write a neat and fancy html page but many things
confuse me due to a the incompatibilities. Using only html seems so boring,
though CSS helps a bit. I'm trying to use an external JavaScript program to
show my side menu which links to my other pages depending on which product
they want to look at. Would it be better to write the external code in some
other language so that all browsers can see it or will it always be hit and
miss depending on the users browser? What got me wondering this is the fact
that users can turn off the JavaScript capability.

Thanks,
Thad

Why do you suppose you cannot get neat and fancy with html and
css? It is the result that counts, not the process of getting it.
Some of the best websites are really boring to make, the makers
yawning their way through the lot; everyone else being immensely
grateful. As for css helping a bit, what? For you to be less
bored?

Time for you to have a decko at

<http://www.csszengarden.com/>

But it also sounds like you want to get your hands on
programming. Look at PHP, this can be used for running programs
on the server and delivering results to the web browsers, you can
do all sorts of mighty things then... but you still will need to
get to grips with html and css independently. It is just that
with server side scripting you can get fancier and neater control
over the whole process of managing and delivering the final
product.
 
T

Thad

I guess what I'm trying to ask is... what is the best way to write html
pages to avoid browser incompatibilities without always having to do browser
type checking?
 
D

dorayme

"Thad said:
I guess what I'm trying to ask is... what is the best way to write html
pages to avoid browser incompatibilities without always having to do browser
type checking?

Wow! You sure fooled me then. What you said had no relation in
the words you used to anything on this subject. I hope it is not
going to go on like this? btw... please don't top post.

Perhaps you best start at:

http://www.htmldog.com/

Read as much as you can stand from

<http://www.w3.org/TR/1999/REC-html401-19991224/>

and keep referring to it.

Go to your library or bookshop and read:

"Cascading Style Sheets" by Hakon Wium & Bert Bos

(no, they are not characters from the Simpsons...)
 
T

Thad

dorayme said:
Wow! You sure fooled me then. What you said had no relation in
the words you used to anything on this subject. I hope it is not
going to go on like this? btw... please don't top post.

Perhaps you best start at:

http://www.htmldog.com/

Read as much as you can stand from

<http://www.w3.org/TR/1999/REC-html401-19991224/>

and keep referring to it.

Go to your library or bookshop and read:

"Cascading Style Sheets" by Hakon Wium & Bert Bos

No, it won't go on. I have resolved myself to writing my web pages in xhtml
strict with JavaScript and CSS. Thank you for the referrals as I will be
looking into them, though I peeked at the web page you referred.

Thank you,
Thad
 
D

dorayme

"Thad said:
No, it won't go on. I have resolved myself to writing my web pages in xhtml
strict with JavaScript and CSS. Thank you for the referrals as I will be
looking into them, though I peeked at the web page you referred.

Just reconsider this resolve. A knowledgeable partner of mine
once said:

The expert advice is to use HTML 4.01, but you can of course use
technobabble-XHTML _if_ you are careful enough to follow
guidelines that effectively make it HTML 4.01 with pointless
kludges.

You could look at <http://dorward.me.uk/>

For now, simply write your html docs under

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

Forget about JS till you can do without it and produce sensible
useful pages - for at least the simple reason that a non trivial
number of people have it disabled. Having reached this milestone,
you can use JS to thrill and delight and enhance. First things
first.
 
J

John Hosking

Thad said:
No, it won't go on. I have resolved myself to writing my web pages in xhtml
strict with JavaScript and CSS. Thank you for the referrals as I will be
looking into them, though I peeked at the web page you referred.

If you're worried about browser incompatiblities, then steer clear of
XHTML for now. Stick with HTML 4.01 strict (validated) for your content,
with CSS for styling, and where it adds something, JavaScript for those
who can benefit from it.
 
R

Roy A.

No, it won't go on. I have resolved myself to writing my web pages in xhtml
strict with JavaScript and CSS. Thank you for the referrals as I will be
looking into them, though I peeked at the web page you referred.

If you are going to use JavaScript (EMCA) with xhtml you got to write
it so it works in xhtml and in xhtml served as "text/html". You don't
want it to breake. You can't use document.write, and if you are
working with e.g. element names you have to look for both DIV (classic
html) and div (xhtml). Hopefully, if you use JavaScript by heart,
these links will let you write code that don't use browser type
checking:

http://www.w3.org/DOM/
http://www.w3.org/TR/DOM-Level-2-Core/ecma-script-binding.html

I don't know any good books/referances that sorts these things out.
But you got to get a bigger picture. I suggest this site for an
overview:

http://www.w3schools.com/

But don't forget where the real good stuff is: W3C.

---
Bulletproof Web Design: Improving flexibility and protecting against
worst-case scenarios with XHTML and CSS
by Dan Cederholm

CSS Mastery: Advanced Web Standards Solutions
by Andy Budd, Simon Collison, Cameron Moll
 
T

Thad

Roy A. said:
If you are going to use JavaScript (EMCA) with xhtml you got to write
it so it works in xhtml and in xhtml served as "text/html".

I'm sorry, I don't understand what EMCA stands for or where you would place
the "text/html". My css sheets are called by...
<style type="text/css" title="currentStyle" media="screen">
@import "igcss.css";
</style>
and my external java is called by...
<script type="text/javascript" src = "menujs.js">
said:
You don't want it to breake. You can't use document.write, and if you are
working with e.g. element names you have to look for both DIV (classic
html) and div (xhtml). Hopefully, if you use JavaScript by heart,
these links will let you write code that don't use browser type
checking:
Uh oh...you say I can't use document.write? That's exactly what I got
working. If not document.write as in the following example, what would
you suggest?

Example from my js page:
document.write("<dl id=\"menu\">");
document.write("<dt class = \"btn\"><a href=\"beverage.html\">Beverage
Insulators</a></dt>");
document.write("<dt class = \"btn\"><a href=\"carflags.html\Car
Flags</a></dt>");
document.write("<br />");
document.write("<dt class = \"btn\">More soon</dt>");
document.write("<dt class = \"btn\">Such as...</dt>");
document.write("<br /><br />");
document.write("Bookmarkers<br />");
document.write("Dog Tags<br />");
document.write( said:
But don't forget where the real good stuff is: W3C.

Oh, I visit there often. There is so much information, I am overwhelmed.
Love the validation.


Thanks Roy (and all the others who have replied)
Thad
 
A

Andy Dingley

I don't understand [...] where you would place the "text/html".

Then you're really _not_ in any position to use XHTML.

Stay with HTML 4.01 Strict


(and do some fecking searching of the archive. This is a twice-weekly)
 
A

Adrienne Boswell

Uh oh...you say I can't use document.write? That's exactly what I
got
working. If not document.write as in the following example, what would
you suggest?

Example from my js page:
document.write("<dl id=\"menu\">");
document.write("<dt class = \"btn\"><a href=\"beverage.html\">Beverage
Insulators</a></dt>");

Your example looks like you are using js for a menu - perhaps something
that gets included in all pages. Not a good idea. Why? Because a lot
of visitors (including the most important) do not have js available.

You're better off using something server side:

<!-- #include file="menu.inc' -->


This is what most of my pages look like under the hood (most ASP):
<% option explicit
thispage = "Page title"
thisurl = "thisurl.asp"
%>
<!--#include file="linkrel.asp"-->
</head>
<body>
<!--#include file="header_inc.asp"-->
<!--#include file="nav_inc.asp"-->
<div id="content">
</div>
<!--#include file="footer_inc.asp"-->

Linkrel includes the doc type declaration, the title element, external
stylesheet and js file and other elements that go in the head.
Header_inc may or may not include a static header logo, etc. Nav_inc is
navigation, and is done server side. Footer_inc includes the standard
copyright information and closes any db connections.

This "template" system makes it very easy for me to a) reuse code b)
debug VERY easily.
 
T

Thad

Adrienne Boswell said:
Your example looks like you are using js for a menu - perhaps something
that gets included in all pages. Not a good idea. Why? Because a lot
of visitors (including the most important) do not have js available.

You're better off using something server side:

<!-- #include file="menu.inc' -->


This is what most of my pages look like under the hood (most ASP):
<% option explicit
thispage = "Page title"
thisurl = "thisurl.asp"
%>
<!--#include file="linkrel.asp"-->
</head>
<body>
<!--#include file="header_inc.asp"-->
<!--#include file="nav_inc.asp"-->
<div id="content">
</div>
<!--#include file="footer_inc.asp"-->

Linkrel includes the doc type declaration, the title element, external
stylesheet and js file and other elements that go in the head.
Header_inc may or may not include a static header logo, etc. Nav_inc is
navigation, and is done server side. Footer_inc includes the standard
copyright information and closes any db connections.

This "template" system makes it very easy for me to a) reuse code b)
debug VERY easily.
WOW...Thank you so VERY much for that information Adrienne. I will have to
look into whether or not my server will allow that. Once again, thank you
so very much.
 
E

Ed Seedhouse

I guess what I'm trying to ask is... what is the best way to write html
pages to avoid browser incompatibilities without always having to do browser
type checking?

Well the first part is to learn to write vailid semantic html in a
strict document type. Without that you have no real basis for what you
want to do. Mark up your content with html tags that reflect the
meaning of the content. Once that's done and you have valid content per
the W3C is about the first time you should even think about layout.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top