如何强制所有链接在iframe中打开 [英] How to force all links to open in iframe

查看:108
本文介绍了如何强制所有链接在iframe中打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法强制每个链接在iframe中打开?我控制了一些我想要展示的网站而不是其他网站。我愿意使用php或javascript。

Is there a way of forcing every link to open in an iframe? I have control of some of the websites I want to show but not others. I am willing to use php or javascript.

谢谢

推荐答案

你可以使用jQuery:

You can use jQuery:

$(document).ready(function(){
   $('a').attr('target', 'iframeNameHere');
});

这里小样本。

这篇关于如何强制所有链接在iframe中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆