<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>close()</title> <script type="text/javascript"> function Wopen(){ var str = window.confirm("确定"); var mywin="http://www.imooc.com"; if(str){ var mywin; window.prompt("输入你要打开的网址",mywin); window.open(mywin); } } </script> </head> <body> <form> <input name="button" type="button" value="新窗口打开" onclick="Wopen()"/> </form> </body> </html>
已解决