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