#2707 closed bug (patchwelcome)
Event isn't fired into an iframe
Reported by: | telega | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.2.4 |
Component: | event | Version: | 1.2.3 |
Keywords: | needsreview | Cc: | |
Blocked by: | Blocking: |
Description
Code $("iframe").contents().trigger("myevent"); doesn't fire event to iframe contentDocument.
Attachments (2)
Change History (6)
comment:1 Changed 14 years ago by
Changed 14 years ago by
Attachment: | jquery.contextswitch.js added |
---|
Changed 14 years ago by
Attachment: | testcase.zip added |
---|
comment:2 Changed 14 years ago by
I've encountered the same problem. I've attached a test case. I tried appying the jquery.contextswitch.js to it but it's not working either. Any ideas? The cross-frame event just gets swallowed.
Working on IE8/FF3.0.7.
comment:3 Changed 12 years ago by
Keywords: | needsreview added |
---|---|
Status: | new → open |
This could only be supported *at all* if the domains were the same, but even then I don't think we want to say we support it. There are issues with cleaning up cross domain events as well, see #7045.
comment:4 Changed 12 years ago by
Resolution: | → patchwelcome |
---|---|
Status: | open → closed |
Having one frame control and trigger events across frames (parent to child or vice-versa) is not supported right now. There are several security and memory leak issues that would need to be overcome. It might be possible for us to provide hooks that allow an external plugin to do this, if you are interested please contact us.
This really cannot be considered a bug if the event was setup from within the iframe. Because of the iframe you are working with two DOMs. Outside the frame (DOM1), the event does not exist because it was setup in the iframe (DOM2). Attached is a proof of concept plugin that allows context switching. Meaning if contents() sees that the current element is an iframe, and contains jQuery, the chain is switch from the outer instance of jQuery to the inner instance. Allowing events to be trigger. Testing so far has been limited just to showing it works (FF3.0.3).