function openWindow() { var myopen; var mysure=confirm("are you sure"); myopen=prompt("open the window","http://www.imooc.com/"); if(mysure) { window.open(myopen,'_blank','width=400,height=500'); } }
把myopen=prompt("open the window","http://www.imooc.com/"); 中的网址改http://www.imooc.com/
<script type="text/javascript">
function openWindow(){
var k_open;
var temp=confirm("是否新打开窗口?")
if(temp)
{
k_open = prompt("请输入你要打开的网址:","http://www.imooc.com/");
window.open('http://www.imooc.com/','_blank','width=400,height=500,');
}
}
</script>
<script type="text/javascript">
function openWindow(){
// 新窗口打开时弹出确认框,是否打开
var judge = confirm("是否打开?");
// 通过输入对话框,确定打开的网址,默认为 http://www.imooc.com/
if(judge){
//打开的窗口要求,宽400像素,高500像素,无菜单栏、无工具栏。
window.open("http://www.imooc.com/","_blank","height=500px,width=400px");
}
}
</script>
http://www.imooc.com/冒号改成英文的