#4464 closed bug (fixed)
IE cannot get width attribute of detached IMG element
Reported by: | netCo | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.6 |
Component: | attributes | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
i have the following code:
htmltmp = '<div style="width: 1100px;"><img src="test.gif" width="300" id="testphoto" /></div>';
alert($('#testphoto', htmltmp).attr('width'));
the internet explorer shows "0" and the firefox shows the right "300".
internet explorer: 7.0.5730.13 firefox: 3.0.8
Change History (5)
comment:1 Changed 13 years ago by
Status: | new → open |
---|---|
Summary: | internet explorer can't work with context → IE cannot get width attribute of detached IMG element |
comment:2 Changed 13 years ago by
Component: | core → attributes |
---|---|
Keywords: | context removed |
Milestone: | 1.4 → 1.6 |
This may be fixed by the attr rewrite in 1.6; need to check once that's landed.
comment:3 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
This bug was a little more complex than that and actually still required a special call in IE, but is fixed. Was related to #5413. http://jsfiddle.net/timmywil/4HQtq/6/
comment:4 Changed 12 years ago by
timmywil, so what was the special call required in IE? I'm experiencing the same issue, but jQuery 1.6 is not an option for me. I need to use 1.3.2.
http://jsfiddle.net/dmethvin/4HQtq/
Confirmed, but only occurs in IE with image elements not attached to the document. The problem is unrelated to context, it is due to the fact that jQuery prefers the image's .width property to its width attribute.