Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 6 years ago

#10582 closed bug (wontfix)

Invalid argument on line 8602 in jQuery 1.6.4 : fx.now has NaN value (IE < 9 only)

Reported by: poulpillusion@… Owned by: poulpillusion@…
Priority: low Milestone: None
Component: effects Version: 1.6.4
Keywords: Cc:
Blocked by: Blocking:

Description

Hi,

I think I found a bug in jQuery 1.6.4 (still present in 1.7.2), in IE < 9 (in fact IE7 and IE8).

Here is a jsFiddle, using 1.6.4 : http://jsfiddle.net/ucmGV/6/

IE8 throws the following error : SCRIPT87: Invalid argument. jquery-1.6.4.js, line 8602 character 5

I (hope that I) fixed this error by slightly changing the source. I replaced this function :

_default: function( fx ) {

if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {

fx.elem.style[ fx.prop ] = (fx.prop === "width"
fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;

} else {

fx.elem[ fx.prop ] = fx.now;

}

}

... with this :

_default: function( fx ) {

if ( fx.elem.style && fx.elem.style[ fx.prop ] != null && !isNaN(fx.now) ) {

fx.elem.style[ fx.prop ] = (fx.prop === "width"
fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;

} else {

if (!isNaN(fx.now)) {

fx.elem[ fx.prop ] = fx.now;

} else {

fx.elem[ fx.prop ] = 0;

}

}

}

Change History (11)

comment:1 Changed 8 years ago by timmywil

Component: unfiledeffects
Owner: set to poulpillusion@…
Priority: undecidedlow
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please reduce the test case to the necessary code to demonstrate the issue to help us assess your ticket.

comment:2 Changed 8 years ago by d.kurdoghlian@…

Should have high priority, since it is breaking execution completely in IE7+8 - thanks for your fix poulpillusion

comment:3 in reply to:  2 Changed 8 years ago by poulpillusion@…

Status: pendingnew

Replying to d.kurdoghlian@…:

Should have high priority, since it is breaking execution completely in IE7+8 - thanks for your fix poulpillusion

You're welcome. I hope it will find it's way in a next release...

comment:4 Changed 8 years ago by timmywil

Status: newpending

This can't have high priority until we have a test case showing the behavior of the bug.

comment:5 Changed 8 years ago by poulpillusion@…

Status: pendingnew

I reduced the test case here : http://jsfiddle.net/ucmGV/7/

As you can see, the "wrong" button produces no error in modern browsers, but gives a Fatal error in IE < 9.

comment:6 Changed 8 years ago by viktor@…

The problem also happens in jquery 1.7.1

Also, it occurs if you pass as the value of the prop to be animated. E.g.: .animate({'padding-top': })

comment:7 in reply to:  6 Changed 8 years ago by anonymous

Replying to viktor@…:

The problem also happens in jquery 1.7.1

Also, it occurs if you pass as the value of the prop to be animated. E.g.: .animate({'padding-top': })

the empty quotes were stripped ""

comment:8 Changed 8 years ago by mikesherov

Resolution: wontfix
Status: newclosed

the fiddle contains the following code:

.animate({marginLeft: '=0'}

which is incorrect usage. The value should either be absolute (ex: 1) or relative (ex: +=1). Considering this is the wrong way to use this function, and isn't supported, I'm closing this issue as wontfix. If you want the error to disappear, please use one of the supported values for animation, located here: http://api.jquery.com/animate/ under the heading "Animation Properties and Values"

Last edited 8 years ago by mikesherov (previous) (diff)

comment:9 in reply to:  8 Changed 8 years ago by anonymous

Replying to mikesherov:

the fiddle contains the following code:

.animate({marginLeft: '=0'}

which is incorrect usage. The value should either be absolute (ex: 1) or relative (ex: +=1). Considering this is the wrong way to use this function, and isn't supported, I'm closing this issue as wontfix. If you want the error to disappear, please use one of the supported values for animation, located here: http://api.jquery.com/animate/ under the heading "Animation Properties and Values"

Well I do know it is an incorrect usage. But I consider that this incorrect usage should throw an error in both IE <9 and all the other browsers. In other browsers it just "dies" silently. Do you consider this difference of behavior as normal or may it be considered as a bug ?

comment:10 Changed 7 years ago by wivlaro

I got this when trying to animate CSS "left" property with a percentage % value. Switching back to a computed pixels value seemed to stop the fx.now from being corrupted on IE8.

comment:11 Changed 6 years ago by Dmitri

I have same issue with jquery 1.7.2 and jquery ui 1.8 when I set value for jquery ui slider $("#slider").slider("value", "0"); in IE8

Note: See TracTickets for help on using tickets.