have a modern purpose? [duplicate]", "text": "<p>I'm reviewing some html produced by an outside shop. </p>\n\n<p>They use comments inside their external script loading tags - so far as i'm aware this was only useful for very old javascript unaware browsers is there any modern function for this or is it redundant?</p>\n\n<pre class="prettyprint"><code>&lt;script type="text/javascript" src="path/to/file.js"&gt;&lt;!--//--&gt;&lt;/script&gt; \n</code></pre>", "answerCount": 1, "upvoteCount": 771, "dateCreated": "2012-02-26 18:59:43", "dateModified": "2022-09-19 07:19:05", "author": { "type": "Person", "name": "MJWadmin" }, "acceptedAnswer": { "@type": "Answer", "text": "<p>No, the habit has not had any grounds for a <em>long</em> time. It was meant to deal with browsers like Netscape 1. Check out e.g. these history notes: http://javascript.about.com/library/blhtmcmt.htm</p>", "upvoteCount": 112, "url": "https://exchangetuts.com/does-script-script-have-a-modern-purpose-duplicate-1640431264639370#answer-1652378728602175", "dateCreated": "2022-09-13 07:19:05", "dateModified": "2022-09-19 07:19:05", "author": { "type": "Person", "name": "Jukka K. Korpela" } } } }
Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does <script><!--//--></script> have a modern purpose? [duplicate]

I'm reviewing some html produced by an outside shop.

They use comments inside their external script loading tags - so far as i'm aware this was only useful for very old javascript unaware browsers is there any modern function for this or is it redundant?

<script type="text/javascript" src="path/to/file.js"><!--//--></script>  
like image 771
MJWadmin Avatar asked Feb 26 '12 18:02

MJWadmin


1 Answers

No, the habit has not had any grounds for a long time. It was meant to deal with browsers like Netscape 1. Check out e.g. these history notes: http://javascript.about.com/library/blhtmcmt.htm

like image 112
Jukka K. Korpela Avatar answered Sep 19 '22 07:09

Jukka K. Korpela