Click to See Complete Forum and Search --> : <Script language=Javascript1.2"
Hi there,
Trying to add <Script language=Javascript1.2> to a web page,
and am getting an error message 'The values permitted for this attribute do not include 'Javascript1.2".
'Javascript' works though.
Can anyone help?
soccer362001
02-23-2004, 10:33 AM
this is the correct way to do it
<script type="text/javascript"></script>
96turnerri
02-23-2004, 11:01 AM
Originally posted by soccer362001
this is the correct way to do it
<script type="text/javascript"></script>
<script type="text/javascript1.2"></script>
fredmv
02-23-2004, 02:02 PM
Originally posted by 96turnerri
<script type="text/javascript1.2"></script>I've made that mistake before, however, it was merely a typo; content-types do not have version numbers and thus it should only be text/javascript.
gil davis
02-23-2004, 07:52 PM
<script language="JavaScript1.2">is valid for Netscape browsers and it indicates that the browser should use JS 1.2 rules as opposed to the default for the particular browser version. IE will not care what the script tag says because it does not support multiple JS versions.
The W3C recommendations for the script tag say that the "language=" part is deprecated because the identifiers are not standard. Actually they are vendor specific, but I guess that if the W3C doesn't have a standard for it, then it isn't standard. So they want to see "type=" and then you have to go fishing for a MIME type (hey, that's real standard, isn't it?) and (oh, yeah BTW) it is still going to be vendor specific. If you make a script tag<script type="text/vbscript">then NS 4 will cough up a fur ball because it will assume that it is Javascript anyway, but Mozilla and NS 6+ will ignore the tag.
So if you don't care about older browsers, depricate away, friends. Otherwise, use both.<script language="JavaScript1.2" type="text/javascript">
...
<script language="JavaScript1.2" type="text/ECMAscript">
...
<script language="JavaScript1.2" type="Jscript">
Yeah, real standard...
96turnerri
02-24-2004, 12:48 PM
ok thanks for the tip fredmv ;)
Vladdy
02-24-2004, 03:50 PM
Originally posted by gil davis
<snip />
So if you don't care about older browsers, depricate away, friends. <snip />
Since
1. Your page should be functional without javascript.
2. There is not ROI trying to script for old browsers
there is no need to use deprecated attributes.
There is one line that deals with older browsers which should be the the first one in your initialization function:
if(!document.getElementById) return;