打开新窗口的代码
var wangzhi; var choice=false; function openWindow() { choice=confirm("是否打开新窗口?"); if(choice==true) {wangzhi=prompt("请输入网址:","http://www.imooc.com"); window.open(wangzhi,'_blank','width=400,height=500,menubar=no,toolbar=no')} else{document.write("yes,sir!")} }