求大神帮忙呀

 function openWindow()
{var open=confirm("确认新建窗口打开网站吗?");
if(open==true)
   {
    var url=prompt("通过输入对话框,确定打开的网址","http://www.imooc.com");
if(url!=null)
   {
window.open(url,"_blank",'width=400px,height=500px,menubar=no,toolbar=no');    
}
  else
{alert("再见!");}
}   
 else
{alert("再见!");}
    }

这个是什么意思为什么有个感叹号,为什么=null,不是=ture吗

if(url!=null)


元歌
浏览 1277回答 3
3回答

千秋此意

!是取反的意思 即 “非”if ( url != null )  即 如果 (url 不等于 null ){ ... }

慕的地8582982

JCSXRHKADKNCFFZIQPWLQGQGJNKURLYUFJISWGKGWMGQENGFFCJQZMMVLEHHNAQGXHCJTDENRIKBHQWADGDPWJMDPIOSCTTWGGCONGQKAREURKDJNRKVGPMZJNAJTENDUHPOSUBTNRORATAWDRBLFJJYIMWSFPYICLHHIZSLJWTBOGDTKXWAEYIILYLYXXQJFTNTAKUXTHQANTQDXPCIGGWWMCZMRBKVMPSFXYYYRXAQRJJJMGOLKKISIYYYQZCYOBVVEEHJMPVIEIBXRCWJJZZIFIYEBVHEQBERMFLIYRANWAENYNOYOISLFJQGZCLOKLTZZCVRLVKDJQQXIIHXHETSFQZMHGQJQRUHRBRCUVSDJWPJTXFEPPKXDNFLRCERJANGSSZWGZHRYWSCSWPGJJTJSRBUYFSBWODNTMMUCZYLSJCBLRRHJLYSVOAUEOBERCSQJYZKDUNWAWAMMZAJGUNHCRUEHKEPBEBMCLBKANSFYREYZCFVFFSRUURCATRRQKZWDXTDJSMPDDXXGKAEONXTPGOKATPPFMMLCDDTIISEVUNEOBEXRAKDKJZHEHBRKOHOXPPKNHKNQYEXXXHEKDDSWWVFWPLUNHQWTSJTYUUEUYRRSZWXDZMWWTEQPDXTDROOBBUKXOPHCBOCBKQRSHSOIEDCVSPTVTXNRGYCWZTGIDMDHAXHYATJJCMSLLIZGJWXHRKQNQGIMFSLYOSLRRRDDGRHRKNXLFRENHRAHTQFQURRLPNKAAXDMIBFOLHZTGURRXHKFSSLPISJAUBGTCQDQXAXVMSVYWDZWSPKXSGPBOERRKRBLEOIVGDZQXKNUEGMKUVVTASSVZWSIBUFVFYQJETTFSIIJSYDWKQQJTTYOLYY

Tobey_滔

!在js中表示非,反,不的意思.....url != null  表示判断url是不是不等于null...
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript