Forum Moderators: open
<script type="text/javascript" language="javascript" src=""></script> When this is the correct way and has been for quite some time.
<script type="text/javascript" src=""></script> I'm not a javascript person and really don't know what adverse effects there would be in removing that language attribute from all javascript references.
Is there a backwards compatibility issue? In this day and age? Anyone?
I really don't know the answer to that one. I was one of those that used both for a while, then just stopped using "language" in there going forward and I haven't had any issues.
I also stopped commenting out the javascript long ago without any adverse affects.
I'm thinking this might get an answer in the JavaScript forum - should we move it there?
I suspect that the only reason developers continue to use it is because they just don't know any better. In fact, I see a lot of this:
<script language="JavaScript">
In other words, not including the type attribute. Again, I think it's just they learned it way back in the day when there was talk of multiple languages being supported, and so they continue to do it that way.
Here's another thing that can be dropped:
<script type="text/javascript">
<!--
// -->
</script>
The html comments were a hack to work with Mosaic and Navigator 1.0. They have not been required for many, many years. Unless you think you need to support those ancient browsers, there's no need to continue writing script like this. And if you do think you need to support those old browsers, you should get your head checked. ;-)
Can anyone tell me why the WebTrends code has 6 different javascript references? They go from 1.0 to 1.5. Nothing like covering your butt from all directions, eh?
<script type="text/javascript" language="javascript 1.0">
<!--
gVersion="1.0";
//-->
</script>
<script type="text/javascript" language="javascript 1.1>
<!--
gVersion="1.1";
//-->
</script>
<script type="text/javascript" language="javascript 1.2>
<!--
gVersion="1.2";
var RE={"%09":/\t/g, "%20":/ /g, "%23":/\#/g,"%26":/\&/g,"%2B":/\+/g,"%3F":/\?/g,"%5C":/\\/g};
//-->
</script>
<script type="text/javascript" language="javascript 1.3>
<!--
gVersion="1.3";
//-->
</script>
<script type="text/javascript" language="javascript 1.4>
<!--
gVersion="1.4";
//-->
</script>
<script type="text/javascript" language="javascript 1.5>
<!--
gVersion="1.5";
//-->
</script>
It does seem like quite a bit of overkill, however. I mean ... c'mon WebTrends ... use some server-side code to obviate the need for such particlization, why dontcha?