這樣寫哦!
?<script type="text/javascript"> ?
? function rec(){
? ? var mymessage=confirm("要打開窗口嗎?") ? ? ? ? ;
? ? if(mymessage==true)
? ? {
? ? ? ?window.open(" http://www.xianlaiwan.cn/",'width:400px,height:500px')
? ? }
? ? else
? ? {
? ? ? ?window.close(" http://www.xianlaiwan.cn/")
? ? }
? } ? ?
? </script>
2016-07-05
?<script type="text/javascript"> ?
? function rec(){
? ? var mymessage=confirm("要打開窗口嗎?");//要養成良好的習慣//
? ? if(mymessage==true)
? ? {
? ? ? ?window.open("http://www.xianlaiwan.cn/","width:400px","height:500px")//要養成良好的習慣//
? ? }
? ? else
? ? {
? ? ? ?window.close("http://www.xianlaiwan.cn/")
? ? }
? }?
//其實我不知道你要問什么// ??
? </script>
2016-07-05
close括號里面空的就可以