开发者

Why is Window.open()'s return type void?

开发者 https://www.devze.com 2022-12-25 13:36 出处:网络
Doing something like this is perfectly permissible in javascript: var newWindow = window.open(...) However, this does not work in the senario of GWT (I am using 1.5 I dont know about later versions

Doing something like this is perfectly permissible in javascript:

var newWindow = window.open(...)

However, this does not work in the senario of GWT (I am using 1.5 I dont know about later versions),

Window window = Window.open("", "", "");

Throws me a compile time error that the open is a method with a return type as void.

Why should it be void ? What if i w开发者_开发知识库ant to close my popup from the main Window ? how do I get its handle ?

I will have to resort to native javascript no doubt but i was just curious so as to why this is so...


I don't know exactly why GWT doesn't support what you're asking for but there is a ticket requesting multiple window support where a number of workarounds are discussed in some detail.

0

精彩评论

暂无评论...
验证码 换一张
取 消