tedster

msg:1479580 | 12:18 am on Mar 21, 2003 (gmt 0) |
JavaScript 1.0 was introduced with Netscape 2.0 (March 1996) and IE3 (June 1996) - and the scripts originally needed to be hidden from earlier browser versions, which tended to print the script on the page because they couldn't understand it. I don't know of any reason to continue with the comment tags. 1996 was a long time ago. Reference: History of JavaScript, jscript and ECMAScript [webmasterworld.com]
|
g1smd

msg:1479581 | 12:24 am on Mar 21, 2003 (gmt 0) |
You should be exporting the javascript to an external .js file, called using: <script type="text/javascript" language="javascript" src="/path/file.js"></script> That makes for a neater HTML page and allows easier updating as the file can be re-used across the whole site.
|
korkus2000

msg:1479582 | 12:26 am on Mar 21, 2003 (gmt 0) |
I think a lot of the problem are cut and paste scripts that still use this convention. It will be a debugging nightmare in the future. "It should work, there is no problem." Finally looking to find that the person still has the JS in comments. Makes me want to put all of my javascripts in a js file.
|
DrDoc

msg:1479583 | 5:57 am on Mar 21, 2003 (gmt 0) |
The problem is also old tutorials that still are surprisingly up to date (for HTML standards) but are hopelessly outdated as far as newer browsers goes... Then, of course, you also have those "blockheaded Bracegirdles from Hardbottle" who teach Web development at Colleges or whatever, and they haven't really kept themselves up to date on browser changes... They think that they don't have to worry about XML/XHTML as long as they teach HTML - which is where they would be wrong.
|
keyplyr

msg:1479584 | 7:51 am on Mar 21, 2003 (gmt 0) |
You should be exporting the javascript to an external .js file, called using: <script type="text/javascript" language="javascript" src="/path/file.js"></script> - g1smd I believe that should now be written as: <script type="text/javascript" src="/path/file.js"></script>
|
g1smd

msg:1479585 | 10:44 pm on Mar 21, 2003 (gmt 0) |
>> old tutorials that still are surprisingly up to date << I have noticed that very few tutorials ever seem to mention adding the type="text/javascript" attribute to the <script> tag, so the result is that nearly every site using javascript fails to validate.
|
|