我什么都對(duì),為什么運(yùn)行不了
?function openwindow()
? var mywin
? ? var mymessage=confirm("你要打開新窗口嗎?");
? ? if (mymessage==true)
{ var mywin=prompt("請輸入要打開的網(wǎng)址","http://idcbgp.cn/");
?window.open('http://idcbgp.cn/','_blank','width=400px,height=500px,menubar=no,toolbar=no')
}
2016-11-07
試試這個(gè),我給你改了一下
function openWindow()
{
? ? var mymessage=confirm("你要打開新窗口嗎?");
? ? if (mymessage==true)
? ? {?
? ? ? ? var mywin=prompt("請輸入要打開的網(wǎng)址","http://idcbgp.cn/");
? ? ? ? if(mywin!=null){
? ? ? ? ? ? window.open('http://idcbgp.cn/','_blank','width=400px,height=500px,menubar=no,toolbar=no');
? ? ? ? }
? ? }
}
2016-11-06
函數(shù)括號(hào)都不加,編譯器只能識(shí)別你的第一條指令為函數(shù)中的操作,后面的成單獨(dú)的指令了
2016-11-03
你的函數(shù)名“openwindow”跟下面<input>標(biāo)簽里onclick那里的函數(shù)名一樣嗎?
2016-11-03
function openwindow()
? var mywin
? ? var mymessage=confirm("你要打開新窗口嗎?");
? ? if (mymessage==true)
{
? mywin=prompt("請輸入要打開的網(wǎng)址","http://idcbgp.cn/");
?window.open(mywin,'_blank','width=400px,height=500px,menubar=no,toolbar=no')
}
試試吧