Hello, I am trying to open a new window in response to a mouse click. The rules of most pop-up blockers allow windows launched by user interaction, but it seems that if the window.open() is inside an closure the window is blocked. this works: clickHandler: function() { window.open() } this doesn''t: clickHandler: function() { myAsyncCall(function() { window.open() } } I am wondering if anybody has encountered this and may have an idea how to pass the identity of the "clickHandler" to the closure. many thank yous, ned --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
GarethAtFlignet
2008-Feb-21 09:31 UTC
Re: bypassing pop-up blockers form within an enclosure
If its suitable in your app, make your async ajax call (if that is what it is) synchronous: new Ajax.Request(theURL, { asynchronous: true, onSuccess: function(transport) { window.open(); } }); If you can''t live with a sync call then I can''t think of any obvious way around this, as window.open must respond to a user event. Regards Gareth On 21 Feb, 06:47, "Ned Schwartz" <ned...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I am trying to open a new window in response to a mouse click. The rules of > most pop-up blockers allow windows launched by user interaction, but it > seems that if the window.open() is inside an closure the window is blocked. > > this works: > > clickHandler: function() > { > window.open() > > } > > this doesn''t: > > clickHandler: function() > { > myAsyncCall(function() > { > window.open() > } > } > > I am wondering if anybody has encountered this and may have an idea how to > pass the identity of the "clickHandler" to the closure. > > many thank yous, > > ned--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
GarethAtFlignet
2008-Feb-21 09:32 UTC
Re: bypassing pop-up blockers form within an enclosure
<laughs> sorry I meant: asynchronous: false : new Ajax.Request(theURL, { asynchronous: false, onSuccess: function(transport) { window.open(); } }); --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks! I am using the asp.net ajax script manager to handle ajax requests in this app... not sure if there is an synchronous switch or not but I will look in to it Ned On Thu, Feb 21, 2008 at 4:32 AM, GarethAtFlignet < garethinwales-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > <laughs> > > sorry I meant: asynchronous: false : > > new Ajax.Request(theURL, { > asynchronous: false, > onSuccess: function(transport) { > window.open(); > } > }); > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Andrew Kaspick
2008-Feb-21 19:19 UTC
Re: bypassing pop-up blockers form within an enclosure
I had this approach working in FF and IE, but safari still blocked the call even if it was synchronous. Do you find the same thing? On Thu, Feb 21, 2008 at 11:41 AM, Ned Schwartz <neddos-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks! > > I am using the asp.net ajax script manager to handle ajax requests in this > app... not sure if there is an synchronous switch or not but I will look in > to it > > Ned > > On Thu, Feb 21, 2008 at 4:32 AM, GarethAtFlignet > <garethinwales-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > > <laughs> > > > > sorry I meant: asynchronous: false : > > > > new Ajax.Request(theURL, { > > asynchronous: false, > > > > onSuccess: function(transport) { > > window.open(); > > } > > }); > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Andrew Kaspick
2008-Feb-21 19:20 UTC
Re: bypassing pop-up blockers form within an enclosure
Sorry, to clarify, safari blocked the window.open call even even though it was made via a synchronous request. On Thu, Feb 21, 2008 at 1:19 PM, Andrew Kaspick <akaspick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I had this approach working in FF and IE, but safari still blocked the > call even if it was synchronous. Do you find the same thing? > > > > On Thu, Feb 21, 2008 at 11:41 AM, Ned Schwartz <neddos-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Thanks! > > > > I am using the asp.net ajax script manager to handle ajax requests in this > > app... not sure if there is an synchronous switch or not but I will look in > > to it > > > > Ned > > > > On Thu, Feb 21, 2008 at 4:32 AM, GarethAtFlignet > > <garethinwales-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > > > > <laughs> > > > > > > sorry I meant: asynchronous: false : > > > > > > new Ajax.Request(theURL, { > > > asynchronous: false, > > > > > > onSuccess: function(transport) { > > > window.open(); > > > } > > > }); > > > > > > > > > > > > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---