我感兴趣的新行为是:
( a)如果我单击“产品”页面中的“返回列表”,是否可以将焦点切换到显示结果列表的原始窗口/选项卡,而不是我在5& 6中描述的内容?
( b)如果答a为“是”,我可以做多个产品窗口吗?如果我重复第2步多次?
发布于 2012-05-08 13:51:26
您也可以这样做:
var BackToList = function() {
window.opener.focus(); // this sets the focus on the window that opened your product
window.close(); // and this closes the product window
};
那么您的链接应该调用BackToList
函数。
如果您的链接是一个简单的a
标记,并且它有一个id,那么您可以在窗口load
事件上这样做:
document.getElementById("the id goes here").onclick = BackToList;
https://stackoverflow.com/questions/10507008
复制相似问题