javascript 为什么这个页面自动关闭不了?必须打开2到3秒在自动关闭

function mm(){ alert('关闭'); window.opener=null; window.close(); } //随机函数 url = new Array(3); url[0] = 'http://www.baidu.com' url[1] = 'http://www.taobao.com' url[2] = 'http://weibo.com' urlx = Math.floor(Math.random() * url.length); document.write('<a id="go" href="'+url[urlx]+'">正在打开..</a>'); go.click();