Whoops... apparently Chrome's pop-up blocker was kicking in :/

On 26 Aug, 16:08, hermis <[email protected]> wrote:
> Hello all,
>
> I can't seem to get Chrome to open a new window using the
> Window.open() function.
>
> It seems to work fine if the function is called from a click handler,
> but not when called directly.
>
> Using Firefox and Internet Explorer the following code launches a
> window on load and a new window each time
> the button is pressed.
>
> public void onModuleLoad()
> {
>                 Window.open("http://www.google.com";, "_blank", "");
>                 Window.alert("Opened window");
>
>                 Button btn = new Button("Launch Window!");
>                 btn.addClickHandler( new ClickHandler()
>                 {
>
>                         @Override
>                         public void onClick(ClickEvent event)
>                         {
>                                 Window.open("http://www.google.com";, 
> "_blank", "");
>                                 Window.alert("Opened window");
>                         }
>                 });
>
>                 RootPanel.get().add( btn );
>
> }
>
> In Chrome, a window is not launched on load, however when the click
> event occurs, it works fine.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to