开发者

stop cross-domain IFRAME links to open in "_top" target

开发者 https://www.devze.com 2023-04-02 12:28 出处:网络
My page loads an IFRAME with content from another domain (and I don\'t have control over the content) that contains links with target=\"_top\" attribute. 开发者_运维问答My page gets completely replace

My page loads an IFRAME with content from another domain (and I don't have control over the content) that contains links with target="_top" attribute. 开发者_运维问答My page gets completely replaced once the user clicks on one of these links. Since my page is a stateful web application it would confuse the user.

Is there a way/trick to stop those IFRAME links to do so? They should either (visually) load within the IFRAME or open in a new window.

I don't want to proxy the IFRAME using a server script and alter the HTML code since this would block any user cookies for the foreign domain.

Perhaps some special trick like nested IFRAMEs or whatever could do this?

0

精彩评论

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

关注公众号