Lgpink
2016-01-09 01:34
<!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 ahou=confirm("shi fou da kai?");
if(ahou==ture)
{
var url=prompt("通过输入对话","http://www.imooc.com");
window.open(url,"_blank",'width=400,height=500');
}
else
{
alert("shu ru zheng que wang zhi");
}
}
else{alert("da kai shi bai");}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
function openWindow() {
var ahou = confirm("shi fou da kai?");
if (ahou == true) {
var url = prompt("通过输入对话", "http://www.imooc.com");
window.open(url, "_blank", 'width=400,height=500');
} else {
alert("shu ru zheng que wang zhi");
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>
<script type="text/javascript">
function openWindow(){
var ahou=confirm("shi fou da kai?");
if(ahou)
{
var url=prompt("通过输入对话","http://www.imooc.com");
if(url=="http://www.imooc.com")
window.open(url,"_blank",'width=400,height=500');
else
alert("shu ru zheng que wang zhi");
}
else
alert("da kai shi bai");
}
</script>
JavaScript入门篇
739817 学习 · 9566 问题
相似问题