0

I wonder why internet explorer does not recognize meta head for javascript set to application/javascript?

<meta http-equiv="x-ua-compatible" content="IE=EmulateIE8"/>
<script type="application/javascript" src="..."/>

doesn't work, but when i change it to

<meta http-equiv="x-ua-compatible" content="IE8"/>
<script type="application/javascript" src="..."/>

it works..

i'd like to use default javascript type that is "application/javascript"

2
  • Your question seems to be missing some text. When you change it to what? Commented Apr 21, 2011 at 15:57
  • Sounds like a bug to me. The docs for x-ua-compatible don't mention this difference. Commented Apr 21, 2011 at 16:02

2 Answers 2

2

[Since you're specifying IE8-compatibility, I presume you're using IE9?]

The problem is your script tag.

<script> cannot be self-closing, so you can't say this as you have:

<script src='...' />

You have to do

<script src='...'></script>

I can't say why your meta tag is affecting it like that, though. Possibly the IE8 rendering engine is more fussy about this point than the IE9 engine.

I would also say that the first version of your meta tag is correct, while the second one isn't, so the second one won't be triggering the browser mode.

Sign up to request clarification or add additional context in comments.

Comments

0

IE9 in compatibility mode and IE8 don't accept application/javascript. They do fine with text/javascript though so you can just use that. Or you can just leave out the type attribute altogether.

This issue sometimes leads to bugs that manifest in surprising ways.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.