To javascript or not to javascript, that is the question (now) was [Sussex] DTD and encoding ????

John D. john at johnsemail.eclipse.co.uk
Mon Jul 11 22:47:52 UTC 2005


Mark Harrison (Groups) wrote:
>On Mon, 2005-07-11 at 19:32 +0100, John D. wrote:
>  
>>Probably a dumb question, I'm trying to re-write my "works" site. As 
>>usual, I'm having to re-learn everything.
>>
>>For accuracy and standards reasons, I like to run my page(s) through the 
>>W3C validator.
>>
>>This is throwing up an error that I don't follow.
>>
>>I've used this
>>
>>*<!DOCTYPE *html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"*>
>>*
>>
>>but when I run it through the validator it tells me that
>>    
>
>
>I tend to put the following before the <HEAD>
>
>
>-----------------------------------------------------------------------
><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
>-----------------------------------------------------------------------
>
>Differences:
>
>- firstly, I tend to use strict - it's been a long time since I've needed to use elements from "transitional".
>
>- secondly, I explicitly define a namespace.
>
>It may be the latter that you need to do. I have to confess an empircal knowledge (ie - I know it works, I've no idea why) approach to XHTML :-)
I tried your suggestion Mark, but still got the same error. After about 
3 hours of digging I've done this

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

Which validates fine in Firefox, but still errors in Opera, why I just 
can't see, but think I'm getting somewhere nearer (if it validates OK 
for opera and firefox then that's fine by me - nuts to IE, I never did 
get on with it!).

Thankyou for the suggestion though Mark.

Further to the above, I'm also as with most things IT, at the earlier 
stages. I want to include a contact address (e-mail) but want to avoid 
as much of the ubiquitous spam as possible, thus far, I found a link in 
one of my magazines that I could just copy to provide the "mailto:" 
address with javascript, but a couple of books I have say that they 
don't like doing that as it necessitates having javascript enabled - the 
page(s) I'm writing are aimed at people who are likely to have that, and 
looking at the options of providing a reply form, seem a little over my 
head at the moment.

Which do you think is correct/the best approach (by way of a little 
"straw poll")?

regards

John D.




More information about the Sussex mailing list