Ruquay
2008-Jan-31 09:54 UTC
Element.Fire on window.parent.document from iframe (fails in Opera)
I wanted to create an iframe that could be included on any page for uploading images, without determining the parent behaviour at all from within the iframe. The iframe include just checks if there was an image loaded, and does this to pass upload information to the parent (this only fires when an image was uploaded): $(window.parent.document).fire(''image:uploaded'', objectWithInformation); On the parent page, I do this: $(document).observe(''image:uploaded'', parentPageCallback); The idea is for different parent pages to be able to include the same image upload module and do different things when an image is uploaded. It works great for FF (2) and IE (7), but in Opera (9) I''ve had trouble with pushing custom events to the parent document. Does anyone know if this is not allowed in Opera, or is perhaps the object hierarchy different? I have also just tested this technique with the latest Safari (3.0.4), and it works without fail. Thanks, Ruquay K Calloway --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---