Skip to main content

Bug Tracker

Side navigation

#9476 closed bug (invalid)

Opened June 01, 2011 03:19AM UTC

Closed September 22, 2011 01:50AM UTC

Last modified September 22, 2011 02:57AM UTC

Calling jQuery("html")[0].removeAttribute throws exception in IE <9

Reported by: rwaldron Owned by: rwaldron
Priority: low Milestone: 1.next
Component: data Version: 1.6.1
Keywords: Cc: jdalton
Blocked by: Blocking:
Attachments (0)
Change History (9)

Changed June 01, 2011 03:19AM UTC by rwaldron comment:1

component: unfiledsupport
owner: → rwaldron
priority: undecidedlow
status: newassigned

Changed June 01, 2011 03:21AM UTC by rwaldron comment:2

Changed June 01, 2011 01:17PM UTC by rwaldron comment:3

cc: → jdalton
component: supportdata

Initially I assumed this would be straight forward, however attempts at writing a failing test ( based on Line 6-7 of the gist provided by Angus Croll [ here: https://gist.github.com/1001726 ]) are unsuccessful.

This test case produced by jdalton was also unsuccessful in reproducing the issue. https://dl.dropbox.com/u/513327/jq_removeAttribute.html

Verification of approach is appreciated, here is the current test I've written:

https://github.com/rwldrn/jquery/blob/a3a301bb5d2b7dcdc1ba12f53b70cddc10607774/test/unit/data.js#L512-535

Changed July 12, 2011 05:43PM UTC by timmywil comment:4

This is a common enough problem, I don't think we need a working test case for it. IE calls the function even when accessed. This often works anyway, but it's best practice to check with typeof or do "removeAttribute" in elem (I prefer the latter).

Changed July 12, 2011 05:56PM UTC by anonymous comment:5

I don't think it's a common enough problem. I am pretty well versed on IE bugs and this one I am not familiar with. Without a working (failing) test case I would simply consider this dev error in diagnosing the problem.

Changed July 12, 2011 05:58PM UTC by jdalton comment:6

_comment0: I forgot to login. The previous comment was mine :P1310494264537420

I forgot to login. The previous comment was mine :P

However I do use an isHostType() function to help avoid these kinda of errors in IE for known problem properties and unknown properties.

http://jsbin.com/erukiv

Changed September 22, 2011 01:50AM UTC by dmethvin comment:7

resolution: → invalid
status: assignedclosed

Lacking a test case, I'm going to close this bug. Twitter is not a good way to report bugs, and his suggested fix of checking for typeof==function doesn't work in IE anyway, as I'm sure we all know.

Changed September 22, 2011 01:51AM UTC by dmethvin comment:8

Oh, I see what timmywil is saying and yes, IE will sometimes call a host function even if you just access it as a property. If you think there's enough info and it can/should be fixed, feel free to reopen.

Changed September 22, 2011 02:57AM UTC by timmywil comment:9

I'm just now seeing the responses. Yes, the common IE issue i was referring to was calling the function when only accessed as a property. We've run into that several times, but it is not an issue with every function.