Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
November 6, 2006, 6:15 pm
rate this thread
validator tells me that the statement
Error Line 38 column 3: invalid comment declaration: found name start
character outside comment but inside comment declaration.
Aside from writing tdiff = tdiff -1; how should I code this?
See www.rurale.ca or specifically
Tony King www.tonyking.tk
Ben C wrote:
Geez! An answer WITHIN MINUTES! And it works!
Last time I posted on GG (a coupla years ago) it took 24 hours for it
to get posted, never mind the answer-time!
I've used => and <= but have nevr come across -= before.
On its own, it isn't.
The only reason why that should occur is if you're using XHTML and
including comments (the markup variety) within the script element. Do
Serving XHTML as text/html is pointless. See previous discussions in
this group for reasons.
The practice of "hiding" scripts is obsolete, doubly so in XHTML where
it literally means to ignore the script: to treat it as a comment.
As I suspected...
Generally: don't use comments in SCRIPT elements (same for STYLE) like
<script ..><!-- .. --></script>
This is for user-agents that do not know the special semantics of SCRIPT and
STYLE. These elements are around for quite a while, so I doupt there's any
user-agent left in the wild, which requires these comments.
And you are using XHTML which makes these comments even more lethal: in
XHTML these comments *are* real comments (in HTML only those deprecated
user-agents would parse it as comments). So if the document is parsed as
XML (parsing XHTML as HTML is just a temporary work-around) as XHTML is
supposed to be and you fixed the parse error, the SCRIPT element would
contain nothing at all.
You have the following options:
- Stick with HTML. In this case you can savely omit the comments.
- If you have very good reasons to use XHTML, use <![CDATA[ .. ]]> instead
of <!-- --> (or nothing at all, if your script does not contain any '<'s
- Move the script to an extenal file and use
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de /
- » HTML reprocessor: how do you get rid of bloated (obese) MS-Word (normal or filtered) HTML?
- — Previous thread in » HTML Authoring Forum