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 🙂

Share it:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Yahoo! Buzz
  • Add to favorites
  • Identi.ca

4 thoughts on “Script tag and attributes

  1. I have almost always used text/javascript and hence never faced this issue. I believe Komodo Editor should fix this bug pronto.

    @Radoslav: True, the captcha is hard to read 😉 I prefer the math captchas more.

  2. Thanks for your replays. In fact I fixed the auto complete code, so from now on I shoud not face such problem.

    About captcha – it’s an plugin, I cant change it much 🙁

  3. I’ve been using Wynsyntax forever. Hadn’t heard about of Komodo Editor before. Guess I need to crawl out from under my rock more often.

Leave a Reply

Your email address will not be published. Required fields are marked *