Is there any Ja开发者_如何转开发vaScript syntax to make sure, across prevalent browsers, merely single child window will be created when users click buttons or hyperlinks?
Thanks.
Just always use the same target
whether it's a link or a window.open call.
<a href="foo.html" target="child">foo</a>
window.open("bar.html", "child");
In which context are you talking about. Checking whether a tab of a certain kind is already open is not possible because it imposes security risks.
However, if you are suggesting to only have one window opened as Invoked by:
window.open(strUrl, strWindowName, strWindowFeatures)
Then you will only be able to have one window open at any time with a specified strWindowName.
精彩评论