Bug Tracker

Ticket #10982 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

In IE (6/7/8) had the following error:"Invalid argument. Line: 8826 Char: 5" on jquery-1.7.1.js

Reported by: joao.l.castro@… Owned by: joao.l.castro@…
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

Solved by checking if "fx.now" is NaN

Change History

comment:1 Changed 3 years ago by sindresorhus

  • Owner set to joao.l.castro@…
  • Status changed from new to pending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate:  http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:2 Changed 3 years ago by anonymous

Had the same issue on IE with jQuery returning an error for a missing/invalid argument. It was caused by a call $(element).show() after a $(‘document’).ready().

I fear IE completely misses to pass some element feature (width? display status? visibility status?), or in some way those features are not readable to IE, or become available slight AFTER the .ready() is called.

Anyway, removing that .show() solved the whole thing.

comment:3 Changed 3 years ago by Davide Losito

Sorry for the "anonymous"... forgot to put my name

comment:4 Changed 3 years ago by anonymous

Is there any update on this?

comment:5 Changed 3 years ago by addyosmani

#11104 is a duplicate of this ticket.

comment:6 Changed 3 years ago by trac-o-bot

  • Status changed from pending to closed
  • Resolution set to invalid

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

comment:7 Changed 3 years ago by cr125rider

I have the same bug happening. The bug you reference as a duplicate, points to this bug as it's duplicate (circular duplicate reference :( ) Anyone find an fix for this?

comment:8 Changed 3 years ago by cr125rider

I found a fix, in jQuery 1.7.1. fx.now somehow gets set to NaN. I don't know much about jQuery internals, but I can hack together a quick fix:

Starting at Line 8824

_default: function( fx ) {
			if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
				if(isNaN(fx.now)) fx.now = fx.start; //Fix line
				fx.elem.style[ fx.prop ] = fx.now + fx.unit;
			} else {
				fx.elem[ fx.prop ] = fx.now;
			}
		}

comment:9 Changed 3 years ago by dmethvin

That's great! All we need now is to know the cause. Please post a test case, as mentioned in comment 1 above.

comment:10 Changed 3 years ago by Hw2k

Not sure if this is the common cause, but I managed to reproduce the error by accidentally setting the animate value to Infinite when calculating the top position with percentages, simplified example here:  http://jsfiddle.net/HdyFB/8/

I guess it's no wonder the animation doesn't work, but a more helpful error message would be nice, rather causing an javascript error in IE<9

Note: See TracTickets for help on using tickets.