473,595 Members | 2,474 Online
Bytes | Software Development & Data Engineering Community
+ 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 2541
"Richard Cornford" <ri*****@litote s.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*****@litote s.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.javas cript 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
4367
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 solution where and which part of the code should be placed/inserted in the main HTML code? Sometimes a Javascript functionality is split up to several parts and/or it makes a big difference where the Javascript code should run/be called (e.g. -...
195
8460
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 network. I have downloaded, and installed CSE HTML Validator Pro, but I don't get the same results with that as I do with the online validator on W3.org. And I can't upload files to W3.org either, due to all the ASP code I use.
15
1445
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 LANGUAGE="JavaScript"></SCRIPT> here is the problem when i tried this in my own component it would not work until i used the tag like this <SCRIPT TYPE="text/javascript"></SCRIPT>
1
1288
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/ , http://developer.netscape.com/ ). Are these links down for good or just temporarily? I checked the latest FAQ on this newsgroup and it still lists the devedge.netscape.com site as the reference location. Note that I do not have a specific Javascript question here --...
10
1907
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" content="text/html; charset=iso-8859-1" /> <script language="JavaScript" type="text/javascript"> //<!]>
6
19611
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 beast, and where might I get it? TIA Neill
2
3047
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 what I'm hoping to achieve. I've never before had to use Javascript closures, but now I do, so I'm making an effort to understand them. I've been giving this essay a re-read: http://jibbering.com/faq/faq_notes/closures.html
9
2503
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 -- comp.lang.javascript FAQ <URL: http://jibbering.com/faq/ >
0
7883
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8019
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8251
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5839
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3873
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3911
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2391
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1490
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.