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