开发者

jQuery broken in IE7 & IE9 only

开发者 https://www.devze.com 2023-02-27 08:44 出处:网络
For some reason, on this really simple page, jQuery will not work on IE7 or IE9, yet it works in IE8 and all other modern browsers. Any ideas why this might be the case?

For some reason, on this really simple page, jQuery will not work on IE7 or IE9, yet it works in IE8 and all other modern browsers. Any ideas why this might be the case?

$(document).ready(function() {

$(".thumb").fancybox();

$("a.group").fancybox({
    'transitionIn'  :   'elastic',
    'transitionOut' :   'elastic',
    'speedIn'       :   600, 
    'speedOut'      :   200, 
    'overlayShow'   :   false
});

$('.note').live('click', function() {
   开发者_如何转开发 $(this).parents('.result').next('.notes').slideToggle();
});

});

Baffling. Any help would be greatly appreciated! BTW, if you'd like to check out the whole deal, you can see it at http://moveout.dancormier.com Thanks in advance.


Try a newer, or older, version of jQuery.


Can you tell us what errors you're encountering when viewed in IE? (The prospect of booting up a Windows VM and IE to look for myself is not exactly appealing)

A guess:

A lot of times IE7/IE8 seems to be very picky about JSON notation. e.g., if you end an object literal with a , it bugs out.

{foo1: 'bar',
 foo2: 'baz',} // <-- This , seems to be ignored by everything but IE

So perhaps you should play around with your object literal there? Maybe don't quote the keys and remove the superfluous spacing between the key, : and value.

General advice:

Try using the DebugBar to debug problems in IE. It's certainly no FireBug but its the best you can get for free for IE debugging.


What exactly are the errors that you're getting?

I don't know about jQuery and IE per se, but I did have to tango with fancybox a while back with IE 7. I kept getting UI layout errors related to the IFRAMEs that fancybox were throwing out.

If this sounds like what you're getting, I posted a blog post on a workaround I did at that time if you're interested in looking at it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号