admin管理员组文章数量:1333613
So I got three pieces of code to load stuff into div and do other things. But it doesn't work with Internet Explorer, I checked IE11 console and that's what I got
SCRIPT5009: '$' is undefined
That's odd, in every other browser it works fine, I tried to google it but didn't find any solution to this.
Here's my jQuery:
<script type="text/javascript">
$('#description').load('descr/portDefault.htm');
$('#portNav').load('menus/default.htm');
@edit
I guess I forgot to put the entire code, here it is: This html is an iframe in another html file if that makes a difference.
So I got three pieces of code to load stuff into div and do other things. But it doesn't work with Internet Explorer, I checked IE11 console and that's what I got
SCRIPT5009: '$' is undefined
That's odd, in every other browser it works fine, I tried to google it but didn't find any solution to this.
Here's my jQuery:
<script type="text/javascript">
$('#description').load('descr/portDefault.htm');
$('#portNav').load('menus/default.htm');
@edit
I guess I forgot to put the entire code, here it is: http://pastebin./xCL1e7Fh This html is an iframe in another html file if that makes a difference.
Share Improve this question edited Nov 21, 2013 at 0:38 user2660811 asked Nov 21, 2013 at 0:29 user2660811user2660811 2434 gold badges9 silver badges16 bronze badges 14- Where do you load the actual jQuery library? – Tieson T. Commented Nov 21, 2013 at 0:31
-
3
So, obviously your IE11 is having trouble loading jQuery. You will have to give us some more clues as to what is going on before we'd have any idea why. Are you loading anything
async
ordefer
? Please include in your question the exact code that loads jQuery before you use it. Do you have any code that is doing$.noConflict()
. Are you using an jQuery plugins? Are there any other errors shown in the error console? – jfriend00 Commented Nov 21, 2013 at 0:33 - here's the entire code pastebin./xCL1e7Fh – user2660811 Commented Nov 21, 2013 at 0:38
- no other errors, just this one 3 times – user2660811 Commented Nov 21, 2013 at 0:40
- 3 Fixed, IE is stupid as hell. All I had to do was to put the SAME src for jquery in main page and in iframe. My iframe page was in another folder so src paths were different which caused the problem, all I had to do is either move my iframes to the same folder as main page and change the src path to be the same, or change src path in iframe to the same as main page but copy jquery.js to the folder where my iframes are stored. That's confusing I know. – user2660811 Commented Nov 21, 2013 at 2:08
1 Answer
Reset to default 4In my case I thought I had the fix with the patability set in the meta tag.
<meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1" />
It worked, but that triggered me to check patablity settting in IE11. For a previous project I had added localhost to the list in the Compatability View Settings.
Cleared the list and it works well now (without the meta tag).
本文标签: javascriptMy jQuery is not working with IE11Stack Overflow
版权声明:本文标题:javascript - My jQuery is not working with IE11 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742276462a2445287.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论