syg6
2007-Sep-27 10:48 UTC
How to call a javascript in parent page from a Prototype Window?
Hello all. (If some of you are seeing this twice I apologize. After posting using Nabble I got an email saying I would have to join the group to post, so I joined and re-sent.) I''ve been messing around with this all morning. I''ve looked at all the examples ... there doesn''t seem to be a mailing list for the Prototype Window Class but people seem to know a lot about it on this list so I''ll try my luck. I open a Prototype Window and display a list. When the user clicks on one of the elements in the list I would like to call a js function I have defined in the page that opened the Window. How do I do this? I''ve tried ''old school'' parent, parent.opener ... I''ve also tried using observers but they don''t seem to be triggering. Can someone throw me a clue? Thanks, Bob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
syg6
2007-Sep-27 11:43 UTC
Re: How to call a javascript in parent page from a Prototype Window?
Figured it out myself. There were a few things were messing me up. 1. I had defined an ''onDestroy'' observer, when I needed an ''onClose'' observer. 2. I am using jQuery with Prototype. Since the js function I was calling in the parent page was failing I figured it was Prototype''s fault. It wasn''t. Instead of using ''$'' as I have until now for my jQuery stuff I have to use ''jQuery''. (eg. instead of ''$ ("span#street").html(text);'' use ''jQuery("span#street").html(text);'') 3. So as it turns out, when you define an observer and stick js stuff in it, like function calls, these functions are in the PARENT page where you define the window (just as I wanted) not in the window that is created. 3. From WITHIN the created window if you call ''top'' you have access to the parent page, just like in the old days. That''s all. Hope my ''Prototype Window Class for Idiots'' guide helps someone ... BOb On Sep 27, 12:48 pm, syg6 <syg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello all. > > (If some of you are seeing this twice I apologize. After posting using > Nabble I got an email saying I would have to join the group to post, > so I joined and re-sent.) > > I''ve been messing around with this all morning. I''ve looked at all the > examples ... there doesn''t seem to be a mailing list for the Prototype > Window Class but people seem to know a lot about it on this list so > I''ll try my luck. > > I open a Prototype Window and display a list. When the user clicks on > one of the elements in the list I would like to call a js function I > have defined in the page that opened the Window. How do I do this? > > I''ve tried ''old school'' parent, parent.opener ... I''ve also tried > using observers but they don''t seem to be triggering. > > Can someone throw me a clue? > > Thanks, > Bob--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
syg6
2007-Sep-29 09:16 UTC
How to call a javascript in parent page from a Prototype Window?
I''ve been messing around with this all morning. I''ve looked at all the examples ... there doesn''t seem to be a mailing list for the Prototype Window Class but people seem to know a lot about it on this list so I''ll try my luck. I open a Prototype Window and display a list. When the user clicks on one of the elements in the list I would like to call a js function I have defined in the page that opened the Window. How do I do this? I''ve tried ''old school'' parent, parent.opener ... I''ve also tried using observers but they don''t seem to be triggering. Can someone throw me a clue? Thanks, Bob -- View this message in context: http://www.nabble.com/How-to-call-a-javascript-in-parent-page-from-a-Prototype-Window--tf4527604.html#a12918725 Sent from the RubyOnRails Spinoffs mailing list archive at Nabble.com. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Tobie Langel
2007-Sep-29 10:13 UTC
Re: How to call a javascript in parent page from a Prototype Window?
Hi, there actually is a forum (http://pwc-forum.xilinus.com/) and a mailing list (http://fates.multisite.site5.com/mailman/listinfo/ javawin_xilinus.com) for PWC. Hope this helps. Regards, Tobie On Sep 29, 11:16 am, syg6 <s...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> I''ve been messing around with this all morning. I''ve looked at all the > examples ... there doesn''t seem to be a mailing list for the Prototype > Window Class but people seem to know a lot about it on this list so I''ll try > my luck. > > I open a Prototype Window and display a list. When the user clicks on one of > the elements in the list I would like to call a js function I have defined > in the page that opened the Window. How do I do this? > > I''ve tried ''old school'' parent, parent.opener ... I''ve also tried using > observers but they don''t seem to be triggering. > > Can someone throw me a clue? > > Thanks, > Bob > -- > View this message in context:http://www.nabble.com/How-to-call-a-javascript-in-parent-page-from-a-... > Sent from the RubyOnRails Spinoffs mailing list archive at Nabble.com.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---