-4

在过去的两天里,我一直被困在我的项目上。我在 Jsp 中使用 window.open() 进行按钮类型输入。作为:-

HTML

     <td colspan="2" align="right"><input type="button" value="Report" id="btn1" 
     onclick="window.open('<%= url %>')"></td>  

但是,当我在 window.open 中的 url 位置传递 String 时,它可以正常工作。

Javascript:

    onclick="window.open('<%= "http://www.google.com" %>')"

请帮助我,在此先感谢

4

1 回答 1

1

代码没有问题。希望您之前已经初始化了 url。可能是变量 url 为空。

于 2013-08-09T12:14:46.423 回答