远去的蝉鸣
2015-06-29 17:29
<!DOCTYPE html>
<html>
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<script type="text/javascript">
function openWindows(){
var open=confirm("open or not");
if(open==true)
{var url=prompt("is this address?","http;//www.imooc.com");
if(url !=null)
{window.open(url,"_blank,",'width=600px,height=400px,menubar=no,toolbar=no');
}
else{alert("see you again");
}
else{alert("see you");}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>
复制那么一大蛋子代码有什么用?把关键地方代码复制过来就行了,看着烦
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function openWindow(){
var open=confirm("open or not");
if(open==true){
var url=prompt("is this address?","http;//www.imooc.com");
if(url !=null){
window.open(url,"_blank,",'width=600px,height=400px,menubar=no,toolbar=no');
}
else{
alert("see you again");
}
}
else{
alert("see you");
}
}
</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=gbk" /> <script type="text/javascript"> function openWindows(){ var open=confirm("open or not"); if(open==true){ var url=prompt("is this address?","http;//www.imooc.com"); if(url !=null){ window.open(url,"_blank,",'width=600px,height=400px,menubar=no,toolbar=no'); }else{ alert("see you"); alert("see you again"); } } } </script> </head> <body> <input type="button" value="新窗口打开网站" onclick="openWindows()" /> </body> </html>
哥们,工欲善其事,必先利其器!刚学吗?HBuilder,给你推荐个开发平台。
JavaScript入门篇
741116 学习 · 9865 问题
相似问题