三水梅林
2019-01-02 21:12
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>window.open</title>
<script type="text/javascript">
function Wopen(){ var mymessage= confirm("确定要打开B站吗");
if(mymessage==true);
{
window.open('https://www.bilibili.com' ,'_blank','height=600,width=400,top=100,left=0');
}
else
{
alert("打开失败!");
}
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="点击我,打开新窗口!" / >
</body>
</html>
还有alert后面的分号好像是中文的
应该是网页上编写的一些功能实现不了 我在开发软件上试了一下是可以实现的
这两个
if(mymessage==true);后面分号去掉
去掉 if 后面的分号
JavaScript入门篇
741604 学习 · 9869 问题
相似问题