On 22 juil, 11:21, Paul Grenyer <[email protected]> wrote: > Hi All > > I've got a bit of a problem opening new tabs. I found the following link: > > http://brainreaders.blogspot.com/2009/10/open-new-tab-in-gwt.html > > and from that I've derived: > > private static native void getURL(String url) > /*-{ > $wnd.open(url,'target=_blank') > }-*/; > > It works perfectly with firefox, but in Internet Explorer I get: > > --------------------------- > Message from webpage > --------------------------- > UncaughtExceptioncom.google.gwt.core.client.JavaScriptException: > (Error): Invalid argument. > number: -2147024809 > description: Invalid argument. > --------------------------- > OK > --------------------------- > > I'm somewhat lost. I suspect it doesn't like the url type, maybe. Can > anyone tell me what I need to do, please?
The second argument *is* the target, so you don't need the "target=" (and that's what generates the error; just tried it in IE8's Developer Tools): window.open(url, "_blank"); But actually, Window.open(String,String,String) in GWT is just that; you don't need JSNI: Window.open(url, "_blank", ""); You can use either the empty string or null as the third argument if you don't need specific features. -- 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.
