2013-02-27 80 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會給你更多關於參數的信息。