Tuesday, 26 January 2016

Re: Big push on testing needed

On 26 January 2016 23:58:51 GMT+00:00, John Rickman Iyonix <rickman@argonet.co.uk> wrote:
>Dave Higton wrote
>
>> In message <57e4a64755.iyojohn@rickman.argonet.co.uk>
>> John Rickman Iyonix <rickman@argonet.co.uk> wrote:
>
>>>As far as I know javascript should ignore html comments and the
>>>javascript validator does not flag them as errors
>>>
>>> http://www.javascriptlint.com/online_lint.php
>
>> My reference suggests that an HTML comment is /not/ a legal
>Javascript
>> comment. Perhaps you should open a discussion with the author of the
>> above application. I would, of course, be very interested to know
>the
>> conclusion!
>
>It doesn't really matter now as I have changed all the comments to
>"proper" JavaScript style. I don't remember where I got the idea that
>html style was acceptable in JS, but the article in this link says
>they are ok:-
> http://www.javascripter.net/faq/comments.htm
>
>I will investigate further.

They must be OK to some extent, because the old advice was to encapsulate everything within <script> tags within an HTML comment to stop the script being displayed on screen.

I don't know if that practice is still common, but NetSurf should probably support it if it doesn't already. (<style> tags have the same advice btw)

Chris

No comments:

Post a Comment