為什么打不開網(wǎng)站啊
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>? ?
? <script type="text/javascript">??
? ? function openWindow(){
? ? ? ? alert("成功1);
? ? ? ? var mychar = confirm("是否打開新窗口");
? ? ? ? // 新窗口打開時(shí)彈出確認(rèn)框,是否打開
? ? ? ? alert("成功2");
? ? ? ? if(mychar==ture)
? ? ? ? {
? ? ? ? ? ? alert("成功");
? ? ? ? ? ? ?var myopen =prompt("新網(wǎng)頁地址是","http://idcbgp.cn");
? ? ? ? ? ? ?//通過輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? ? ? ? ? ?if(myopen!=null)
? ? ? ? ? ? ?{
? ? ? ? ? ? ? ? ?window.open(myopen,'_top','width=500,heigth=400,menuber=no,toolbar=no');?
? ? ? ? ? ? ?}? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? ? ? ? ? ?else
? ? ? ? ? ? ?{
? ? ? ? ? ? ? ? ?alert("退出!")
? ? ? ? ? ? ?}
? ? ? ? ? ??
? ? ? ? }else
? ? ? ? {
? ? ? ? ? ? alert("退出!")
? ? ? ? }
? ? ? ??
? ? }
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2018-07-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 mm=confirm("彈出對(duì)話框?")
? ? ? ? if(mm==true){
? ? ? ? ? ? window.open(' http://idcbgp.cn/','_blank','width=400,height=500,menubar=no,toolbar=no')
? ? ? ? }
? ? }// 新窗口打開時(shí)彈出確認(rèn)框,是否打開
? ? // 通過輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ??
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
//不用那么麻煩,alert是警告,不能通過它打開網(wǎng)站
2018-07-09
2018-07-08
而且? 別用那么多? alert? ?都給攔截了
2018-07-08
老鐵? ? chu 吃無儲(chǔ)======true !!!!