怎么調(diào)用鏈接,大神?
<!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 abc=prompt("確認(rèn)打開這個(gè)網(wǎng)址嗎?", "http://yifanck.cn");
? ? ? ? ? ?if(abc!=null)
? ? ? ? ? ?{
? ? ? ? ? ? ? ?alert(window.open('url', '_blank','width=400,height=500,menubar=no,toolbar=no'))
? ? ? ? ? ?}
? ? ? ? ? ?else
? ? ? ? ? ?{
? ? ? ? ? ? ? ?abc.close()
? ? ? ? ? ?}
? ?</script>
</head>
<body>
<input type="button" value="新窗口打開網(wǎng)站" onClick="openWindow()" />
</body>
</html>
點(diǎn)button沒反應(yīng)
2017-09-07
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
? ??
? function openWindow(){?
? ? ? confirm("是否打開網(wǎng)站");// 新窗口打開時(shí)彈出確認(rèn)框,是否打開
var abc=prompt("輸入要打開的網(wǎng)址","http://");
? ? if(abc==null)// 通過輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為 http://yifanck.cn/
{}else{
? ? window.open(abc,'_block','width=400px,height=500px,menubar=no,toolbar=no')
} //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ?
? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
這個(gè)是我的作業(yè)你可以參考一下
2017-09-07
<!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 abc=prompt("確認(rèn)打開這個(gè)網(wǎng)址嗎?");
? ? ? ? ? ?if(abc!=null)
? ? ? ? ? ?{
? ? ? ? ? ? ? ?window.open('http://yifanck.cn','_blank','width=400,height=500,menubar=no,toolbar=no');
? ? ? ? ? ?}
? ? ? ? ? ?else
? ? ? ? ? ?{
? ? ? ? ? ? ? ?abc.close()
? ? ? ? ? ?}
? ?</script>
</head>
<body>
<input type="button" value="新窗口打開網(wǎng)站" onClick="openWindow()" />
</body>
</html>
2017-09-07
url換成abc
2017-09-07
??alert(window.open('url', '_blank','width=400,height=500,menubar=no,toolbar=no'))去掉alert試一試