Skip to main content

Bug Tracker

Side navigation

#12945 closed bug (fixed)

Opened November 22, 2012 05:21PM UTC

Closed January 04, 2013 10:34PM UTC

Last modified September 17, 2013 11:30PM UTC

attr throws exception in IE9 on Flash <object>s

Reported by: der.Schtefan@gmail.com Owned by: der.Schtefan@gmail.com
Priority: high Milestone: 1.9
Component: attributes Version: 1.8.3
Keywords: Cc:
Blocked by: Blocking:
Description

attr throws exception in IE9 on Flash <object>s

IE9 does not seem to have the method getAttribute on Flash <object>s.

I changed line 2321 from

ret = elem.getAttribute( name );

to

ret = elem.getAttribute ? elem.getAttribute(name) : null;

to make it work.

Triggered this bug in combination with Uploadify Flash and jquery.validate.

Attachments (0)
Change History (22)

Changed November 22, 2012 05:31PM UTC by dmethvin comment:1

owner: → der.Schtefan@gmail.com
status: newpending

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.

Changed November 28, 2012 05:43PM UTC by dmethvin comment:2

#12977 is a duplicate of this ticket.

Changed November 29, 2012 06:30AM UTC by Niphor comment:3

Replying to [comment:2 dmethvin]:

#12977 is a duplicate of this ticket.

Here is my reduced test case

http://jsfiddle.net/Niphor/6Uh9j/

I have to import swfupload.js to make the swf work properly。

I don't know why you can't visit demo.swfupload.org,but i must use it's swf.

(IE just stop download the swf on googlecode,I don't know why...)

don't use Firebug Lite,it doesn't show anything on IE>=9 when the bug occurs.

it seems that the bug only happens when swf bind some js callback,or need trigger some js event,or something.

I haven't figured it out. Sorry.

Changed November 29, 2012 03:16PM UTC by dmethvin comment:4

component: unfiledattributes
milestone: None1.9
priority: undecidedblocker
status: pendingopen

Ok, thanks for the test case! I agree with the OP, it looks like Flash objects do not have getAttribute and we need to check for the method before trying to use it.

Changed December 16, 2012 08:38PM UTC by dmethvin comment:5

priority: blockerhigh

Changed January 04, 2013 10:34PM UTC by Dave Methvin comment:6

resolution: → fixed
status: openclosed

Fix #12945. Check for .getAttribute so IE9 is happy.

Changeset: a95f35744aff95a446cc05e1d8c558b3a4867836

Changed January 05, 2013 03:31AM UTC by Dave Methvin comment:7

Ref #12945, IE9/10 still needs safe .getAttribute check.

Changeset: c0241a47e270cd0e0ac2b2a0fdefc5a3a15b5ae6

Changed January 16, 2013 11:18PM UTC by anonymous comment:8

I think this may have broke the use of .attr('name') on xml elements.

Changed January 16, 2013 11:20PM UTC by dmethvin comment:9

We'd need a test case to know, anonymous.

Changed February 11, 2013 10:14PM UTC by anonymous comment:10

The fix is not working on IE10

if ( typeof elem.getAttribute !== core_strundefined ) {

getAttribute is null, core_strundefined is undefined, they are unequal and we have got exception.

Changed February 27, 2013 04:06AM UTC by dmethvin comment:11

@anonymous, you're saying that elem.getAttribute is null? Do you have a test case?

Changed April 10, 2013 04:30AM UTC by anonymous comment:12

i have this bug when using uploadify on ie9. this fix is not working. Anyone have a solution?

Changed April 10, 2013 12:51PM UTC by dmethvin comment:13

Go ask in the uploadify forum: http://www.uploadify.com/forum/#/categories/uploadify-bugs

If someone can come up with a test case we can look at it. And by that I mean a test case not using Uploadify.

Changed April 10, 2013 04:28PM UTC by gibson042 comment:14

I took a stab at this, and got passes on all BrowserStack IE9 and IE10 options: http://jsfiddle.net/L3wHg/2/.

It sure looks to me like Uploadify is doing something unusual, so we need someone to specifically identify the trigger and make a case for support.

Changed April 23, 2013 03:33PM UTC by happypoulp comment:15

I reproduced this issue too with swfupload.

For me the patch for this ticket is incomplete:

Current fix:

if ( typeof elem.getAttribute !== "undefined" )

A valid and more bullet proof fix would have been:

if ( elem.getAttribute ) or if ( jQuery.isFunction(elem.getAttribute) )

Changed April 23, 2013 04:10PM UTC by dmethvin comment:16

Your solution wouldn't seem to work on IE 6/7/8. If you think there's still a problem and want to propose a fix, please create a new ticket with a reduced test case. A pull request with a unit test would be wonderful too, if you can come up with one, thanks!

Changed May 13, 2013 04:56PM UTC by paol comment:17

Could this bug be reopened please? The same test (typeof elem.getAttribute !== core_strundefined) is causing problems in IE 6.

Specifically, IE will return "unknown" instead of "undefined" for certain typeof operations and when that happens the test incorrectly succeeds.

I have changed the test to jQuery.isFunction(elem.getAttribute) as suggested by happypoulp and it seems to be working correctly.

Unfortunately I can't provide a static html test case, as I'm only getting the error in a complex page after some doing some ajax requests.

Changed May 13, 2013 07:12PM UTC by timmywil comment:18

@paol: It won't do much good to reopen without a test case. We need some way to reproduce it.

Changed May 14, 2013 10:06AM UTC by paol comment:19

Replying to [comment:18 timmywil]:

Unfortunately I can't create a static test case, as I said. Some spurious object is being left on the page (and I can't discover anything about it in debugging because every property of it seems to be unknown, even tagName).

However the "unknown" vs "undefined" problem in IE is widely known, and it's plain to see that the test being used in the code will not handle a return of "unknown" correctly. I think that is enough reason to correct the test.

Changed May 14, 2013 12:07PM UTC by gibson042 comment:20

Replying to [comment:19 paol]:

However the "unknown" vs "undefined" problem in IE is widely known, and it's plain to see that the test being used in the code will not handle a return of "unknown" correctly. I think that is enough reason to correct the test.

If it's widely known, it ought to be widely reproducible. Please, update http://jsfiddle.net/L3wHg/2/ to demonstrate the behavior.

Changed August 22, 2013 12:37PM UTC by one@ffully.com comment:21

there is a same bug in:

acceptData: function( elem ) {
		var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];

		// nodes accept data unless otherwise specified; rejection can be conditional
		return !noData || noData !== true && elem.getAttribute("classid") === noData;
	}

Changed September 17, 2013 11:30PM UTC by anonymous comment:22

I would also vote that this bug gets reopened. I see this bug using IE10 when a selector like '[data-provide="typeahead"]' is run and tries to get the attribute from a FLASH OBJECT.

This is the easiest way you can see the error: http://jsfiddle.net/L3wHg/6/

Click the 'select files' button, dismiss the dialog that opens, and note the errors from jQuery.