采用默認網址時,新打開的頁面上方顯示地址有問題,頁面無法顯示
?<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>? ?
? <script type="text/javascript"> ?
??? function openWindow(){
??????? var tt=confirm("是否打開?");
??????? if(tt==true){
??????????? var url=prompt("確定要打開以下網址嗎?","http://www.xianlaiwan.cn/");
??????????? if(url!=null){
??????????????? window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no');
??????????? }else{
??????????????? alert("這么溜的嗎");
??????????????? // document.write("可以的");
??????????? }
??????? }
??? }
??? // 新窗口打開時彈出確認框,是否打開
??? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
??? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
?? ?
?? ?
? </script>
?</head>
?<body>
?? ?? <input type="button" value="新窗口打開網站" onclick="openWindow()" />
新打開的慕課網頁面網址顯示為:http://www.xianlaiwan.cn/code/http%EF%BC%9A//www.xianlaiwan.cn/
2017-08-14
冒號是中文的!改成英文的冒號就對了window.open('http://www.xianlaiwan.cn/','width=400,height=500')
2017-08-09
新網頁鏈接為:www.xianlaiwan.cn/code/http:www.xianlaiwan.cn/ ? 求諸位大神指教
2017-08-09
url里的網址的 : 這個是在中文輸入法下打的,瀏覽器不識別吧