function openWindow(){ var url =prompt("输入对话框","http://www.imooc.com"); if (url!=null){ window.open(url,"_self","width=400px,height=500px,menubar=no,toolbar=no");} }
现在会了,这样就行了。
<script type="text/javascript">
function openWindow(){
if (confirm("是否打开?")){
}
var hello=prompt("输入对话框","http://www.imooc.com");
window.open(hello,"_blank","winth=400,hight=500,menubar=no,toolbar=no");
}