Tag Archives: Javacript

Script tag and attributes

I’ve lost precious time wondering why a Javascript code is working properly in FireFox, while on IE it’s not working at all. First thought was that the script is incompatible, but the final result was pretty stupid.

The reason:
The script tag was written this way:

<script type="application/x-javascript">
....
</script>

changing the type attribute to “text/javascript” do the magic:

<script type="text/javascript">
....
</script>

The first code is created from autocomplete snipped in Komodo Editor. So, use “text/javascript” type attribute in order to reduce headaches 🙂