-2

I want to invoke a function like openInfoWindow(SomeClass sc), sc as a parameter. However,codes like this openInfoWindow(new SomeClass(){width=1;}) didn't work out. Is it invalid for a anonymous class to be passed into a function as a parameter in Javascript?

looking forward to your help!!

4

1 回答 1

0

您的代码在语法上不正确,请尝试

openInfoWindow(new function(){this.width=1;})
于 2013-10-29T02:35:26.293 回答