$('#cptagswrap').click(function() {
window.open('tags.php');
});
这将打开一个新的浏览器标签并加载tags.php
。
我首先需要检查tags.php
是否已经打开过。
类似的东西:
if (tags.php).is(':open') {goto tags.php;}
else {window.open('tags.php');}
任何帮助?
答案 0 :(得分:0)
从@Amy所说的文件中复制:
var windowObjectReference = null; // global variable
function openFFPromotionPopup() {
if(windowObjectReference == null || windowObjectReference.closed)
/* if the pointer to the window object in memory does not exist
or if such pointer exists but the window was closed */
{
windowObjectReference = window.open("http://www.spreadfirefox.com/",
"PromoteFirefoxWindowName", "resizable,scrollbars,status");
/* then create it. The new window will be created and
will be brought on top of any other window. */
}
else
{
windowObjectReference.focus();
/* else the window reference must exist and the window
is not closed; therefore, we can bring it back on top of any other
window with the focus() method. There would be no need to re-create
the window or to reload the referenced resource. */
};
}