jQuery issue in Internet Explorer 8

2020-01-24 10:43发布

I am trying to get my jQuery functions to work on IE8. I am loading the library from Google's servers (http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js).

The $(function(){}) is never called. Instead, I get an error Object expected. I opened the developer and ran typeof $ in the console, and it came up as undefined.

I have tried going to other sites that I know use jQuery (jquery.com), and those all work, is there something I might be missing here?

20条回答
小情绪 Triste *
2楼-- · 2020-01-24 11:29

This fixed my issue in IE8:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>

Running on localhost, I had to change the https:// to http://

If I try to browse to the secure link, I get the Internet Explorer cannot display the webpage friendly warning.

Always try to load your text scripts in a browswer first if there are issues!

查看更多
甜甜的少女心
3楼-- · 2020-01-24 11:29

OK! I know that jQuery is loading. I know that jQuery.textshadow.js is loading. I can find both of the scripts in Developer Tools.

The weird part: this code is working in the content area but not in the banner. Even with a dedicated fixIE.css. AND it works when I put the css inline. (That, of course, messes up FireFox.)

I have even put in a conditional IE span around the text field in the banner with no luck.

I found no difference and had the same errors in both jquery-1.4.2.min.js and jquery-1.2.6.min.js. jquery.textshadow.js was downloaded from the jQuery site while trying to find a solution to this problem.

This is not posted to the Website

查看更多
登录 后发表回答