<!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 open=confirm("是否打开网址?");
if(open==true)
{
var url=prompt("请输入需要打开的网址","http://www.imooc.com/");
if (url!=null){wiondow.open(url,'height=500,width=400,toolbar=no,menubar=no,_blank')
else{alert=('再见好吗')}
}
else{alert=('再见2')}
}
</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 openWindow(){
var open=confrim("你确定打开慕课网?");
if(open==true)
{
windows.open(http:www.imooc.com,wideth=400px,height=px,menubar=no,toolbar=no)}
else
{document.write("谢谢")}
// 通过输入对话框,确定打开的网址,默认为 http://www.imooc.com/
//打开的窗口要求,宽400像素,高500像素,无菜单栏、无工具栏
</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 openWindow() { var open = confirm("是否打开网址?"); if (open == true) { var url = prompt("请输入需要打开的网址", "http://www.imooc.com/"); if (url != null) { wiondow.open(url, 'height=500,width=400,toolbar=no,menubar=no,_blank') }else { alert = ('再见好吗') } }else { alert = ('再见2') } } </script> </head> <body> <input type="button" value="新窗口打开网站" onclick="openWindow()"/> </body> </html>
if 后面少一个 }