这样运行就没问题了
function openWindow(); var bb,mymessage=confirm(“确定打开新窗口吗”); if(mymessage==true) { var bb=prompt("输入网址:","www.imooc.com/") window.open(bb,'_blank','width=400,height=500,menubar=no,toolbar=no, status=no,scrollbars=yes'); } }
2016-05-19
<!DOCTYPE html> <html> <head> <title> new document </title> <meta charset="utf-8"> <script type="text/javascript"> function openWindow(){ var message=confirm("是否打开新窗口"); if(message==true){ var popen=prompt('输入网址','http://www.imooc.com/'); window.open(popen,'_blank','width=400,height=500,menubar=no,toolbar=no'); } } </script> </head> <body> <input type="button" value="新窗口打开网站" onclick="openWindow()" /> </body> </html>
举报