關(guān)于window.open的疑問(wèn)
為什么這樣不行?點(diǎn)擊按鈕確定,并沒(méi)有打開(kāi)網(wǎng)頁(yè)
function openWindow(){
? ? ? ? var openp = confirm("shifoufakai ?");
? ? ? ? if (openp == ture)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? window.open('http://idcbgp.cn/' , '_black','menubar=no','toolbar=no');
? ? ? ? ? ? }
? ? ? ? else
? ? ? ? ? ? window.close();
? ? ? ? }
? ??
2016-08-26
? ? ? ? ? ?去掉 window.close();,因?yàn)檫@樣會(huì)產(chǎn)生邏輯矛盾。寫(xiě)成return試試
2016-08-26
window.open()的第三個(gè)參數(shù)要放在一個(gè)引號(hào)內(nèi),用,隔開(kāi)
2016-08-26
true
2016-08-26
對(duì)不起看錯(cuò)了
檢查一下
_blank ?ture
2016-08-26
樓上回答的應(yīng)該是對(duì)的吧
2016-08-26
function少了}
else少了{(lán)