var mywin=confirm("请确认是否在新窗口打开网页?")
if(mywin){
window.open('http://www.imooc.com','_blank','width=400','height=500','menubar=no','toolbar=no');
}else{}
在else里面打个空白就行了
if(mywin){
window.open('http://www.imooc.com','_blank','width=400','height=500','menubar=no','toolbar=no');
}else{ };