I guess one easy option is to call a outside function like

       new Ajax.Request('someURL', {
          onSuccess: function(response) {
            var success = response.responseText;
            success == "true" ? openPopup("http://google.com";) :
openPopup("http://yahoo.com";);
          }
        });

function openPopup(site){
    window.open(site);
}

mmm but what I don't know is if the browser is going to keep blocking
the new window... the only difference with this is the scope.

but that should be work...
Nahum

On Jul 10, 7:49 am, Hari <hariharanwebm...@gmail.com> wrote:
> Hi,
>
> I have hyperlink. When a user clicks on it, i would make a ajax call
> to get the location where a new browser window should be opened.
>
> for example:
>        new Ajax.Request('someURL', {
>           onSuccess: function(response) {
>             var success = response.responseText;
>             success == "true" ? window.open("http://google.com";) :
> window.open("http://yahoo.com";);
>           }
>         });
>
> But problem is the window.open is called as part of onSuccess
> callback. So the browser popup blocker blocks the call.
>
> How can I get around this problem and want the popup to open.
>
> Thanks,
> Hari

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to