要崩溃了,到底哪里些的有问题,和别人的对比了半天,找不到错,求告知啊!
function openWindow(){
var isopen=confirm("是否弹出输入对话框");
if(isopen){
window.open(" http://www.imooc.com/",'_blank',"width=400,height=500,menubar='no',toolbar='no'")
}else{
}
}
function openWindow(){
var isopen=confirm("是否弹出输入对话框");
if(isopen){
window.open(" http://www.imooc.com/",'_blank',"width=400,height=500,menubar='no',toolbar='no'")
}else{
}
}
2018-11-20
给你一份我写的
<html>
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<script type="text/javascript">
function openWindow(){
var message = confirm("是否打开");
if ( true == message )
{
var url = prompt("确认打开的地址,默认地址如下","http://www.imooc.com/");
if ( url != null && url !='' ){
window.open(url,"_blank","width=400,height=500,menbar=no,toolbar=no");
}
else {
document.write("你没有输入url,并且取消了默认URL");
}
}
else
{
document.write("你选择否");
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>
举报