為什么不顯示?
<!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 chen=confirm("是否打開網(wǎng)址");
? ? ? ? ?
? ? ? ? if(chen==true)
? ? ? ? {
? ? ? ? ? var wei=prompt("input url:","http://idcbgp.cn/")
? ? ? ? ?window.open('wei','_blank','width=400px,height=5oopx,menubar=no,toolbar=no')
? ? ? ? }
? ? }
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2018-10-07
另外還有兩個(gè)問題,
1、默認(rèn)網(wǎng)址http://idcbgp.cn/不能是中文冒號
2、window.open的第一個(gè)參數(shù)因?yàn)槭亲兞棵圆荒艽蛞?/p>
2018-10-07
函數(shù)名不對應(yīng),onclick="openWindow()" 和function openwindow()中w一個(gè)大寫一個(gè)小寫