<script type="text/javascript">
function openWindow(){
var ts=prompt("是否打开?","http://www.imooc.com");
if(ts!=null)
window.open(ts,"_blank","width=400px,height=500px,menubar=no,toolbar=no");
}
还有就是你if语句少了个花括号{
function openWindow(){
var shifou = confirm("是否打开");
if( shifou == true){
window.open('http:www.imooc.com/','width=400px,height=500px,menubar=no,toolbar=no');
}
}