简体   繁体   English

如何在javascript中重新加载另一个选项卡?

[英]How to reload another tab in javascript?

I work on an admin-side database and we want the admin to open clients' account.我在管理端数据库上工作,我们希望管理员打开客户的帐户。 Since we use session variables, we want to restrain the admin to one client account at a time.由于我们使用会话变量,我们希望一次将管理员限制为一个客户帐户。

So here's the plan, when selecting a first client, the client-side page loads in a new tab. So here's the plan, when selecting a first client, the client-side page loads in a new tab. If the admin selects a new client, the new tab reloads for this client.如果管理员选择了一个新客户端,则为该客户端重新加载新选项卡。

For now, I tried using a global variable named clientWindow and when a client is selected, I do For now, I tried using a global variable named clientWindow and when a client is selected, I do

clientWindow = window.open('site.html?playerid='+playerid, '_blank');
clientWindow.focus();

But it still opens a new tab.但它仍然会打开一个新标签。 Perhaps I'd need a name to put instead of _blank!也许我需要一个名字来代替_blank! Thanks for you help.谢谢你的帮助。

Give the window an actual name, rather than _blank.给窗口一个实际的名称,而不是 _blank。 Then it becomes part of the DOM, and you can access it directly.然后它成为 DOM 的一部分,你可以直接访问它。 Including refreshing it包括刷新它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM