walls.corpus

By Nathan L. Walls

IE and JavaScript MIME-type lessons

I’m a jQuery-fan and I recently wrote some forms for CrazyLikeThat using jQuery and AJAX. The goal was to use a Rails application I wrote as a service.

I hit a few roadblocks, though and in solving them, learned some things:

  • While ‘application/javascript’ may be the recommended type attribute to source in Javascript with the <script /> tag, IE doesn’t follow it. Regardless of what MIME-type your server sends JavaScript as, you have to specify ‘text/javascript’ to IE.
  • IE8 has three rendering modes, and there are implications for how to interact with the DOM based on which mode you’re in.