2013-02-27 32 views
0

我有我想开到同一窗口JavaScript的window.open _self发出

if(sgame=='BIN') { 
    window.open('http://<%=Application("domain")%>/client/client.asp?z=<%=encode(session("username")&"|"&session("password")&"|"&session("id"))%>&lang=<%=session("lang")%>&host='+shost+'&port='+sport+'&dat='+sfolder 
      ,'bingogame'+Math.round(Math.random()*9999) 
      ,'_self' 
      ,'resizable=no 
      ,scrollbars=no 
      ,width=1024 
      ,height=768'); 

据我了解,我把“_self”,在正确的地方一些旧代码,但它仍然是开放一个新的浏览器窗口。

回答

0

+sfolder,'bingogame'+Math.round(Math.random()*9999)

上述代码件具有sfolderbingogame之间额外comma。你的第二个参数应该是'_self',但是相反,因为额外的comma,'_self'已成为第三个参数。修复它,它应该工作。

Window.open会给你更多关于参数的信息。