How to force all links to open in iframe

六月ゝ 毕业季﹏ 提交于 2019-12-08 05:16:10

问题


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.

Thanks


回答1:


You can use jQuery:

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

Here little sample.



来源:https://stackoverflow.com/questions/14002867/how-to-force-all-links-to-open-in-iframe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!