鏈接出來的時候會加上原來的
<script?type="text/javascript">??
????
????//?新窗口打開時彈出確認框,是否打開
????//?通過輸入對話框,確定打開的網址,默認為?http://www.xianlaiwan.cn/
????//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
????function?openWindow(){
????????var?massage=confirm("是否打開?");
????????if(massage==true){
????????????var?url=prompt("輸入網址","http://www.xianlaiwan.cn/");
??????????
??????????window.open(url,'_blank','width=400,height=500,menubar=no,toolbars=no')
?????????
????????????
????????}
????}
????
??</script>?
?</head>?
?<body>?
??????<input?type="button"?value="新窗口打開網站"?onclick="openWindow()"?/>?
?</body>結果
http://www.xianlaiwan.cn/code/http%EF%BC%9A//www.xianlaiwan.cn/
2017-03-13
var?url=prompt("輸入網址","http://www.xianlaiwan.cn/");? 網址有問題,冒號寫錯了
2017-03-13
:是英文模式
2017-03-13
http后面的:應該是英文模式下的: