Side navigation
#9298 closed enhancement (fixed)
Opened May 16, 2011 01:42PM UTC
Closed May 16, 2011 02:21PM UTC
Last modified March 08, 2012 05:00PM UTC
$(elem).attr(eventName) not working properly in IE7
Reported by: | s.ronak | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.6.2 |
Component: | attributes | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Attachments (0)
Change History (9)
Changed May 16, 2011 02:21PM UTC by comment:1
resolution: | → fixed |
---|---|
status: | new → closed |
Changed May 16, 2011 02:22PM UTC by comment:2
component: | unfiled → attributes |
---|---|
milestone: | 1.next → 1.6.2 |
priority: | undecided → low |
Changed May 16, 2011 03:07PM UTC by comment:4
Replying to [comment:1 timmywil]:
Use getAttributeNode for ^on attributes in IE6/7 to avoid anonymous function wrapper. Fixes #9298. Changeset: a5cf257a8a240f96f1ec255599fa1d1190f51ff5
I don't this this fix will work. Can I've working example?
Changed May 16, 2011 03:18PM UTC by comment:5
You can use this boilerplate to test the changes: http://jsfiddle.net/rwaldron/w49k8/
Changed May 16, 2011 03:19PM UTC by comment:6
_comment0: | It does. IE6 and 7 wrap anything you put in inline event handlers with an anonymous function, which is why what you get back looks different. See the type check in IE6 or 7 in the fiddle created by this ticket's duplicate: http://jsfiddle.net/timmywil/nhExE/5/. All of this is not really a big concern to the jQuery team, but the fix was easy enough and short. → 1305559219444771 |
---|
It does. IE6 and 7 wrap anything you put in inline event handlers with an anonymous function, which is why what you get back looks different. See the type check in IE6 or 7 in the fiddle created by this ticket's duplicate: http://jsfiddle.net/timmywil/nhExE/6/. All of this is not really a big concern to the jQuery team, but the fix was easy enough and short.
Changed May 17, 2011 05:52AM UTC by comment:7
Replying to [comment:6 timmywil]:
It does. IE6 and 7 wrap anything you put in inline event handlers with an anonymous function, which is why what you get back looks different. See the type check in IE6 or 7 in the fiddle created by this ticket's duplicate: http://jsfiddle.net/timmywil/nhExE/6/. All of this is not really a big concern to the jQuery team, but the fix was easy enough and short.
Ok Timmy, you've fixed it. But what is jQuery edge?? And if I write elem.getAttributeNode('onclick') it returns object. What is the final solution implemented?
Changed May 17, 2011 02:50PM UTC by comment:8
jQuery edge is how jsfiddle refers to the git version of jQuery (I'm not sure why). See the list of libraries on jsfiddle. getAttributeNode does return objects (attribute nodes in fact), but you can then retrieve it's value.
elem.getAttributeNode("onclick").nodeValue
Changed May 18, 2011 06:00AM UTC by comment:9
Replying to [comment:8 timmywil]:
jQuery edge is how jsfiddle refers to the git version of jQuery (I'm not sure why). See the list of libraries on jsfiddle. getAttributeNode does return objects (attribute nodes in fact), but you can then retrieve it's value.> elem.getAttributeNode("onclick").nodeValue >
Hey, thanks Timmy. I know my bug was easy to solve, but still I'm super excited for next release as my query will be resolved in v1.6.2. Yeah...
Use getAttributeNode for ^on attributes in IE6/7 to avoid anonymous function wrapper. Fixes #9298.
Changeset: a5cf257a8a240f96f1ec255599fa1d1190f51ff5