為什么默認(rèn)網(wǎng)址不顯示呢?
function openWindow(){
? ? ?var opennew=confirm("yes or no");
? ? ?if (opennew==true)
? ? ?{
? ? ? ? ? var newurl = prompt("open web page","http://idcbgp.cn/");
? ? ?}
? ? ?else
? ? ?{
? ? ? ? ?return;
? ? ?}
? ? ?if(newnul!==null)
? ? ?window.open([newurl],'_blank',"width=400,height=500","menubar=no","toolbar=no");
? ? ?}
? ? ?else{
? ? ? ? ?document.write("hi")
? ? ?}
2015-07-23
function openWindow(){
? ? ?var opennew=confirm("yes or no");
? ? ?if (opennew==true)
? ? ?{
? ? ? ? ? var newurl = prompt("open web page","http://idcbgp.cn/");
? ? ?}
? ? ?else
? ? ?{
? ? ? ? ?return;
? ? ?}
? ? ?if(newurl!==null){
? ? ?window.open([newurl],'_blank',"width=400,height=500","menubar=no","toolbar=no");
? ? ?}
? ? ?else{
? ? ? ? ?document.write("hi")
? ? ?}
?}
代碼有幾處錯誤,一個是變量名,另一個是{}的成對出現(xiàn)