Previous Message
Next Message

Re: Strict and Javascript

Sent by David Dorward on 7 September 2005 12:12


On 9/6/05, George L Smyth [EMAIL-REMOVED]> wrote:
> I am using <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> as my doctype 

You might want to read:
* http://www.hixie.ch/advocacy/xhtml
* http://www.mozilla.org/docs/web-developer/faq.html#accept

HTML 4.01 is rather better suited to the web of today then XHTML.

> it will not validate because http://validator.w3.org is telling
> me that the less than sign in my "for" statement is not valid [ for (i = 0; i
> < 10; i++) { ].

< indicates that you are trying to start a tag (at least it does
there, if you were using HTML then the content module of the <script>
element would allow you to use < characters freely.

See: http://www.w3.org/TR/xhtml1/#h-4.8

.... and move your script to an external file.

> Also, I have to give an image a name so that I can address it,
> and that is not validating either.

Use an id instead. Name is used pretty much ONLY to decide how the
browser should label the values of form controls when submitting a
form.

> Are these actual problems with Strict or is the validator getting confused. 

See the quote at the top of the validator FAQ page.

-- 
David Dorward <http://dorward.me.uk><http://blog.dorward.me.uk>
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: