為什么打不開網(wǎng)頁啊, 求大神指教是哪里出了問題,謝謝
lx.js代碼:
function openwindow(){
????var mywin1=prompt("是否打開新窗口?");
????if(mywin1==true){
????????var mywin2=("請輸入新網(wǎng)址:");
????????if(mywin2!=null){
????????window.open=("http://idcbgp.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("是否打開新窗口")第一步只需要確認(rèn)就行;
var mywin2 = prompt("輸入新網(wǎng)址:","http://idcbgp.cn" 中缺prompt和默認(rèn)網(wǎng)址;
文中else應(yīng)該為跟第二個(gè)if對(duì)應(yīng);
第一個(gè)if應(yīng)該對(duì)應(yīng)else{document.write("已取消")};
window.open=(mywin2,"_blank","width=400,height=500,menubar=no,toolbar=no");地址用變量mywin2代替。按這樣改試試看行不
2018-09-10
請輸入網(wǎng)址哪里有問題,函數(shù)調(diào)用呢? prompt("請輸入網(wǎng)址:");