大神幫忙看下
<!doctype html>
<html>
? ? <head>
? ? ? ? <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
? ? ? ? <title></title>
? ? ? ? <script type="text/javascript">
? ? ? ? function wopen(){
? ? ? ? ? ? var nline;
? ? ? ? ? ? var oline=prompt();
? ? ? ? ? ? nline=confirm("確定要打開")
? ? ? ? ? ? if(nline)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? window.open(oline,'_blank','width=400,height=500,menubar=no,toolbar=no');
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? </script>
? ? </head>
? ? <body>
? ? ? ? <input name="bt" type="button" onclick="wopen" value="點擊我試試">
? ? </body>
</html>
幫忙看下,為什么點擊“點擊我試試”沒有反應呢
2017-03-01
<input name="bt" type="button" onclick="wopen" value="點擊我試試"> 改為onclick="wopen()"
2017-03-01
onclick里的wopen少了(),
????????????var nline;
? ? ? ? ? ? var oline=prompt();
? ? ? ? ? ? nline=confirm("確定要打開")
? ? ? ? ? ? if(nline)
還有這段代碼根本不知道你要干嘛,你confirm之后想prompt的話,首先要if(nline==true),然后online=prompt('請輸入網(wǎng)址:','http://idcbgp.cn')
2017-03-01
親,你的confirm確認語句后面的if語句并沒有判斷吧,if里面的括號里面改成nline==true試試