Skip to main content

Bug Tracker

Side navigation

#5081 closed bug (invalid)

Opened August 20, 2009 03:28AM UTC

Closed December 17, 2009 03:57AM UTC

An runtime error about invalid argument in IE 7/8 on attr

Reported by: rock3m Owned by:
Priority: minor Milestone: 1.4
Component: core Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:

I found an issue in attr on IE 7/8. IE shows the error happens around the line

if ( set )

elem[ name ] = value;

The problem is in IE it cannot recognise the value of the variable set. I found a solution online,which solved my problem (see below). I'm wondering if this could be a fix.

Attachments (0)
Change History (2)

Changed September 21, 2009 04:49PM UTC by netinho comment:1

I had the same problem, and on IE8 too. So I solved using this way at line 1060 of jquery-1.3.2.js:


    if ( set )
			elem[ name ] = value;


    if ( set ) {
      if ((value == 'NaNpx')||(value == 'px')) value = '';
      elem[ name ] = value;

Now it's working like a charm.

Changed December 17, 2009 03:57AM UTC by dmethvin comment:2

resolution: → invalid
status: newclosed

IE will throw an error if you pass invalid arguments, such as:

$("div").css("border", "4km korean dmz");

jQuery doesn't try to catch these, since they are errors and catching the error would just mask them. When these happen in IE8, use the debugger and trace the stack to see what code outside jQuery is passing in the invalid argument.