慕粉2018168990
2017-03-22 19:32:43
<script type="text/javascript"> ? ? ? ?function openWindow(){ ? ? ? ? ? ?var message=confirm("是否打開對話框"); ? ? ? ? ? ?if (message=="true") ? ? ? ? ? ?{ window.open('http://idcbgp.cn/', ? ? ? ? ? ? ? ? ? ?'width=400','height=500',menubar=no,toolbar=no} ? ? ? ?} ? ? ? ? ? ?else ? ? ? ? ? ?{alert("再見!");} ? ? ? ?} ? ?</script></head><body><input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" /></body>
2 回答
已采納

西蘭花偉大炮
TA貢獻376條經驗 獲得超318個贊
<!doctype?html> <html> <head> ????<meta?charset="UTF-8"?/> ????<title>Document</title> ???? </head> <body> ????<input?type="button"?value="打開新窗口"?onclick="openWindow()"/> ????<script> ???? ????????????function?openWindow(){ ????????????????var?message?=?confirm("是否打開新窗口?"); ????????????if(message?==?true){ ????????????????window.open("http://idcbgp.cn"); ????????????}else{ ????????????????alert("再見!"); ????????????} ????????????}; ???????? ????</script> </body> </html>
寫成這樣就可以了
添加回答
舉報
0/150
提交
取消