Page 1 of 1

Script Error Checking

Posted: Sun Mar 05, 2006 12:52 pm
by paulp575
I keep getting an error about not using '<!--' and '-->' in scripts (to keep older browsers from viewing the contents of the script rather than running the script).

Problem is, on some scripts, if I insert that code, the script no longer runs!!!
Is there a way to avoid this - I don't write the scripts, so changing the scripts is above my head!

Thanks,

Posted: Mon Mar 06, 2006 10:16 am
by Albert Wiersch
Hello,

In XHTML, you shouldn't surround scripts and styles (in the "style" element) with comment markers because they could (and should) be ignored by the browser/agent, but you should be able to in HTML, so it depends on the DOCTYPE.

If you want to simply not use comment markers at all, then you can always disable that validator message by right-clicking on it when it apepars in the Results Window and choosing Options for this Message->Disable Message.

I should probably remove that message by default in v8.0 because most people today don't use such old browsers where not using comment markers would be an issue.

Re: Script Error Checking

Posted: Wed Oct 11, 2006 10:39 am
by thenitbit
paulp575 wrote:I keep getting an error about not using '<!--' and '-->' in scripts (to keep older browsers from viewing the contents of the script rather than running the script).

Problem is, on some scripts, if I insert that code, the script no longer runs!!!
Is there a way to avoid this - I don't write the scripts, so changing the scripts is above my head!

Thanks,
Hi Paul,

I got the same problem earlier, until I realised that comment markers can change a script into a comment when coded on the same line.
Make sure you insert a line break after '<!--' and one before '-->' and everything works fine!

Regards,
Alfred Vorsselman, the Netherlands.