Bug Tracker

Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#5728 closed bug (duplicate)

Cannot access IMG attributes (height, width) in IE if parent is null

Reported by: mazniak Owned by:
Priority: minor Milestone: 1.4
Component: attributes Version: 1.3.2
Keywords: dom, attributes, ie Cc:
Blocked by: Blocking:

Description

On a about:blank page, load jQuery and run the following commands:

foo = $("<img id='foo' src='http://www.google.com/images/srpr/logo1w.png'>"); foo.attr("height", 111); console.log(foo.attr("height")); does *not* work in IE8 console.log(foo.get(0).getAttribute("height")); does return 111

The 'attr()' method does not return the expected values in IE8, but it does so in Firefox and Safari. This can be remedied by appending the IMG element to a DOM element (like 'html' or 'body') and calling 'attr()' again.

Attachments (1)

index.html (825 bytes) - added by mazniak 10 years ago.
A test case for reproducing the bug.

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by mazniak

Attachment: index.html added

A test case for reproducing the bug.

comment:1 Changed 9 years ago by dmethvin

Component: unfiledattributes
Summary: Cannot access some IMG attributes (height, width) while IMG element’s parent is nullCannot access IMG attributes (height, width) in IE if parent is null

comment:2 Changed 9 years ago by snover

Resolution: duplicate
Status: newclosed

comment:3 Changed 9 years ago by snover

Duplicate of #5413.

Note: See TracTickets for help on using tickets.