<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>window.open</title><script type="text/javascript"> function Wopen(){ var mystr = confirm("Do you wanna open imooc in new window?"); if(mystr==True) { window.open('http://www.imooc.com','_blank','menubar=no,toolbar=no,status=no,scrollbars=yes'); } else { alert("Fail!"); } } </script></head><body> <input name="button" type="button" onClick="Wopen()" value="点击我,打开新窗口!" ></body></html>
把True改成true,大小写没注意吧??