為什么在輸入其他網(wǎng)站 的網(wǎng)址的時(shí)候還是跳轉(zhuǎn)到 慕課網(wǎng)的也面 而且還加載失敗 如:我輸入百度的網(wǎng)址他還是跳轉(zhuǎn)到慕課網(wǎng)的頁(yè)面
<!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 app = confirm("你確定打開此窗口嗎");?
? ? ? ? if(app==true){
? ? ? ? ? ? var app1 = prompt("請(qǐng)輸入鏈接","http://idcbgp.cn/")
? ? ? ? }
? ? ? ? else{
? ? ? ? ? ? alert("信息錯(cuò)誤");
? ? ? ? } if(app1 !=null){
? ? ? ? ? ? window.open("app1","小窗口","width=600,height=600");
? ? ? ? }else{
? ? ? ? ??
? ? ? ? }
? ? ? ??
? ? }
? ??
? ? // 新窗口打開時(shí)彈出確認(rèn)框,是否打開
? ? // 通過輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
? ??
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2015-06-21
第二個(gè)if判斷應(yīng)該嵌套在第一個(gè)里面!
2015-06-19
不解釋,自己看