Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的页面中有三个链接,我想限制用户一次打开一个链接。那么当用户点击链接时如何通过javascript检查它是否已经打开了一个窗口(通过打开我的意思是不仅仅是点击链接并关闭它,窗口应该在用户点击链接时打开) .
为窗口命名,然后您可以使用 DOM 访问它们。每次用户打开一个新的弹出窗口时,您都可以运行一个循环来尝试访问所有弹出窗口。如果另一个窗口已经打开,您可以阻止当前的弹出事件发生。
弹出窗口都必须在您的域下才能正常工作。