為什么打不開網頁啊, 求大神指教是哪里出了問題,謝謝
lx.js代碼:
function openwindow(){
????var mywin1=prompt("是否打開新窗口?");
????if(mywin1==true){
????????var mywin2=("請輸入新網址:");
????????if(mywin2!=null){
????????window.open=("http://www.xianlaiwan.cn/","_blank","wdith=400,height=500,nemubar=no,toolbar=no");
????????}
????}
????else{
????????document.write("無輸入,返回");
????}
}
lx.html代碼:
<input type="button" value="新窗口打開" onclick="openwindow()" />
<script src="js/lx.js"></script>
2018-09-11
2018-09-10
mywin1 = confirm("是否打開新窗口")第一步只需要確認就行;
var mywin2 = prompt("輸入新網址:","http://www.xianlaiwan.cn" 中缺prompt和默認網址;
文中else應該為跟第二個if對應;
第一個if應該對應else{document.write("已取消")};
window.open=(mywin2,"_blank","width=400,height=500,menubar=no,toolbar=no");地址用變量mywin2代替。按這樣改試試看行不
2018-09-10
請輸入網址哪里有問題,函數調用呢? prompt("請輸入網址:");