细数繁星闪烁
2016-06-05 17:06
<!DOCTYPE html>
<html>
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<script type="text/javascript">
function openwindow()
{
var cof=confirm("是否打开此网页?");
if(cof)
{ var pro=prompt("确定打开的网址:","www.baidu.com/");
window.open(pro,'_blank','height=500,width=400,menubar=no,toolbar=no');
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>
function openwindow()
{
var cof=confirm("是否打开此网页?");
if(cof)
{ var pro=prompt("确定打开的网址:","http://www.baidu.com/");
window.open(pro,'_blank','height=500,width=400,menubar=no,toolbar=no');
}
}
//不用单击直接执行函数 测试下
openwindow()域名不带 http:// 其实也是有问题的
函数名不一样。大小写不分。。。。
if(cof)应该改成if(cof==ture)没有判断,让程序怎么执行啊
你的函数名openwindow的w是小写,在input框中是大写。不一样,就不能调用函数了,仔细点呀
{ var pro=prompt("确定打开的网址:","www.baidu.com/");
window.open(pro,'_blank','height=500,width=400,menubar=no,toolbar=no');
}
pro 是不是要改成网址
JavaScript入门篇
741617 学习 · 9869 问题
相似问题