473,473 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HTML comments within JavaScript - Netscape documentation ??

Hi there

About this business of embedding HTML comments in Javascript.

Everyone tells me that JavaScript parsing ignores any line starting
with <!--
but that I need to protect any occurrence of --> with a Javascript
comment //.

My browser (IE 6) seems to handle <!-- as described, but also seems
to ignore occurrences of -->, with or without a leading //.

I was trying to look up the official ruling on this in the
JavaScript 1.5 Guide and Reference on Netscape, but I can't seem to
find any mention of it in the various Netscape documents. So is this
an undocumented convention which JavaScript compliant browsers can
choose to handle just as they like ?

thanks

- griff
Jul 20 '05 #1
3 2537
"Richard Cornford" <ri*****@litotes.demon.co.uk> writes:
The browsers that were new when it was introduced are now the oldest
still in use.


They are not even close to being in use. The script tag, and the HTML
comment convetion, was introduced with the transition from Netscape 1
to Netscape 2. The release of Netscape 2.0 was March 1996. Netscape 2
works fine without the HTML comments.

IE supported scripts from v3.0(beta1) in May 1996.

The script tag was then introduced into HTML 3.2, which was made a
recommendation in 1997.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message
news:vf**********@hotpop.com...
The browsers that were new when it was introduced are now
the oldest still in use.
They are not even close to being in use. ...

<snip> ... . The release of Netscape 2.0 was March 1996. ...

<snip>

Yep you are right. I will have to switch to saying "The browsers that
were new when it was introduced are not even still in use.".

(Though I did recently discover that Sheffield university is still
running some machines with Window 3.1 installed, but I doubt that anyone
does much web browsing from them.)

Richard.
Jul 20 '05 #3
On Tue, 29 Jul 2003 12:30:28 +0000 (UTC), "Richard Cornford"
<ri*****@litotes.demon.co.uk> wrote:
But
there is no evidence that any of the browsers that are currently in use
do not know how to handle SCRIPT tags properly, so there is no reason
for using this "hide from older browsers" stuff at all. The browsers
that were new when it was introduced are now the oldest still in use.


Also if you're the sort of person who follows such cargo-cults, you
may be the sort of person to jump on the XHTML bandwagon, and for
XHTML the browser is free to chuck away everything inside a comment,
so your script could simply disappear.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Arthur Connor | last post by:
Is there a way of extracting the Javascript code from the "normal" HTML code (e.g. similar to CSS code which can be put into a separate file) ? If you offer a solution: can I determine in your...
195
by: Torbjørn Pettersen | last post by:
As you might have noticed I'm trying to clean up my web site's HTML code. The way I do it is simply more or less redoing to complete site, testing it on a web server I have set up on my local...
15
by: WStoreyII | last post by:
I dont think that it really matters, but just for my own reference? I found a calendar component tutorial online for html components. in this component the tag for a script was <SCRIPT...
1
by: John C. Ramirez | last post by:
I have been looking for some "definitive" online Javascript documentation and I notice that all of the Netscape links are no longer working (http://devedge.netscape.com/ ,...
10
by: Andrew Poulos | last post by:
While this works on IE 6: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>aiff</title> <meta http-equiv="Content-Type"...
6
by: Wayfarer | last post by:
I Googled on Javascript CHM and came up with a couple of hits, but they were for dead links at http://developer.netscape.com/. I'd really like to have a handy Javascript CHM. Is there such a...
2
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
9
by: dhtml | last post by:
I have written an article "Unsafe Names for HTML Form Controls". <URL: http://jibbering.com/faq/names/ > I would appreciate any reviews, technical or otherwise. Garrett --...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.