开发者

Breaking all frames when clicking URL within last frame

I have a webpage with some frames within each other in it. Last frame loads a website with many URLs. Some URLs have target="_top" and some have target="_blank". When I click to URL with target="_top" it breaks all frames on my parent page and load this URL, but when I click URL with target="_blank" it leaves my parent page as is (with f开发者_如何学运维rames) and opens this URL in a new window. Now the question: how to do that when URL with target="_blank" clicked, beside the opening URL in a new window it breaks all frames in my parent page and close it? Thanks


<a href="your/url" target="_blank" onclick="window.location.href = this.href;">

Does that work? I'm not sure I'm entirely understanding the situation. Or do you want to "close" the parent page, e.g.

<a href="your/url" target="_blank" onclick="window.close();">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜