用得还是不够熟练
function openWindow(){ var OpenNewwindow=confirm("打开imooc网站吗?"); var Newwindowurl; if(OpenNewwindow==true) {Newwindowurl="http://www.imooc.com/"} else {Newwindowurl="null"} window.open(Newwindowurl,'_blank','width=400,height=500,menubar=no,toolbar=no'); }