代碼運(yùn)行時(shí)的問(wèn)題
?function openWindow()
? {
? ? var mymessage = confirm("是否確定打開(kāi)新網(wǎng)頁(yè)?");
? ? if(mymessage == true)
? ? {
? ? ? var webadress=prompt("請(qǐng)輸入網(wǎng)頁(yè):");
? ? ? ? if(webadress!=null)
? ? ? ? {
? ? ? ? ? ? window.open(webadress,'_blank','width=400px,height=400px,menubar=no,toolbar=no');
? ? ? ? }else? ? ? ? ? ?{window.open('http://idcbgp.cn','_blank','width=400px,height=400px,menubar=no,toolbar=no');
? ? ? ? }
? ? }else
? ? {alert("結(jié)束!");}
? }
為什么我的代碼下劃線部分無(wú)法運(yùn)行出來(lái)啊?前面的都可以的
2016-10-24
點(diǎn)擊確定的時(shí)候,不論你是否輸入字符都會(huì)返回一個(gè)string類型的字符串而不會(huì)返回null,只有點(diǎn)擊取消才會(huì)返回null
2016-10-25
? ?祝您學(xué)習(xí)愉快!求采納~
2016-10-24
1. 點(diǎn)擊確定按鈕,文本框中的內(nèi)容將作為函數(shù)返回值
2. 點(diǎn)擊取消按鈕,將返回null
2016-10-24
把px去掉試一試