html-target

How to force link from iframe to be opened in the parent window

有些话、适合烂在心里 提交于 2019-11-26 00:39:41
问题 I need to open the link in the same parent page, instead of open it in a new page. note : The iframe and parent page are the same domain . 回答1: I found the best solution was to use the base tag. Add the following to the head of the page in the iframe: <base target="_parent"> This will load all links on the page in the parent window. If you want your links to load in a new window, use: <base target="_blank"> This tag is fully supported in all browsers. 回答2: Use target-attribute: <a target="