SitePoint Sponsor |
|
User Tag List
Results 1 to 12 of 12
-
May 1, 2002, 06:06 #1
- Join Date
- Jan 2001
- Location
- Ottawa ON
- Posts
- 315
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Why using <script type="text/javascript">
Dreamweaver says that neither Netscape6 or Internet Explorer 6 support the type attribute of the script tag. The only reason that I ever included it was for validators. However, if none of the major browsers are picking it up, is there any non-pedantic point to using it in additional to language=""?
-
May 1, 2002, 06:29 #2
- Join Date
- Jul 2001
- Posts
- 284
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It doesn't hurt any and may actually help to leave it in. I wouldn't go by what Dreamweaver "thinks" is right or wrong.
-
May 1, 2002, 12:35 #3
Well, it sets the mimetype and in the event that the script tag can load other types of scripts besides text-based, it'll be needed. That's my take on it, anyway.
-
May 1, 2002, 13:34 #4
- Join Date
- Jan 2001
- Location
- Ottawa ON
- Posts
- 315
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks for the responses.
I now understand the theoretical basis for the tag.
But I'll just use language since it is a much more specific tag (being able to specify script version as well as type)
-
May 1, 2002, 13:51 #5
- Join Date
- Jun 2001
- Location
- Before These Crowded Streets
- Posts
- 9,446
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I use the type attribute all the time and it works just fine in N6 and IE6
Sketch
-
May 1, 2002, 15:32 #6
- Join Date
- Aug 2001
- Location
- London
- Posts
- 2,475
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
<script type="text/javascript"></script>
is valid xhtml whereas the language attribute has been dropped. So use the above and throw dreamweavers help file in the bin:P
<script language="javascript" type="text/javascript"></script>
-
May 2, 2002, 02:49 #7
isnt it uase to tell scripts apart like >script type="text/VBScript></script>. I don't know for sure, I havn't done much in JavaScript or VBScript.
- the lid is off the maple syrup again!
-
May 2, 2002, 03:52 #8
- Join Date
- Apr 2002
- Location
- A Maze of Twisty Little Passages
- Posts
- 6,316
- Mentioned
- 60 Post(s)
- Tagged
- 0 Thread(s)
As was previously stated the type refers to MIME type and yes Netscape 6.22/Mozilla does understand this, as does Microsoft IE 6.0, for example; when adding CSS you might for instance use; type="text/css"
The "language" attribute within <script> was designed to determine the scripting language, which by default is normally JavaScript that goes back to the early Netscape browsers.
};-) http://www.xhtmlcoder.com/
-
May 2, 2002, 06:57 #9
- Join Date
- Jan 2001
- Location
- Ottawa ON
- Posts
- 315
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Actually, from testing neither IE6 or Netscape6 do anything with the type attribute: you are just as weel to leave it on or off regardless of what scripting language you are using. IE6 will be just as happy with <script> no matter what language is inside the tags.
-
May 2, 2002, 07:29 #10
- Join Date
- Aug 2001
- Location
- London
- Posts
- 2,475
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
although for validation you need type in xhtml so its up to the person preferences, however it's a much better practice to type the language used
-
May 3, 2002, 05:19 #11
- Join Date
- Aug 2001
- Location
- Sweden
- Posts
- 548
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
<script language="javascript" type="text/javascript"></script>
It might be the case that MSIE supports any crap thatīs out there, but if you wanīt your site to be viewable in as many different browsers as possible, I suggest you write it as the standard says!T O B I A S - S T R A N D H | visit my site here
OPERA7 /MSIE6 /FireFox 1.1/Win2000 /ADSL /17" Screen /1024x768
god doesn't create genius, he clones me.............
-
May 7, 2002, 06:11 #12
- Join Date
- Apr 2002
- Location
- A Maze of Twisty Little Passages
- Posts
- 6,316
- Mentioned
- 60 Post(s)
- Tagged
- 0 Thread(s)
I would have to disagree a little with "neither IE6 or Netscape 6 do anything with the type attribute" some browsers may not do anything with the certain type attributes, and yes Micro$oft IE had a major security flaw because it ignored "type".
Albeit it is especially useful for defining which specific helper application/program the browser uses to view the file.
};-) http://www.xhtmlcoder.com/
Bookmarks