iframe显示跨域url页面

可以通过JS搞定跨域问题,但是比较麻烦,我就在后台处理了,其实这样本质上也算不上是跨域了

后台otherwebsite.php:

<?php
$url="www.otherwebsite.com";
echo "
<html>
<head>
    <title></title>
    <meta content='0; url={$url}' http-equiv='refresh'>
</head>
</body>
</html>
"?>

然后把这个php文件的地址放到iframe标签里的src里就可以了:<iframe src="otherwebsite.php"></iframe>

原文地址:https://www.cnblogs.com/ymy124/p/4031845.html