本文最后更新于 2023年10月31日 by 阿喵
如果你有个域名和服务器,但是你又想要目标网站的内容,可以选择套壳。用html的iframe标签实现
iframe还存在一个问题,就是缓存刷新的问题,为了解决缓存刷新导致无法登陆,在bady中加个跳转登陆的按钮
代码如下
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Cache-Control" content="max-age=7200" /> <meta http-equiv="Expires" />
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="main.css">
<title>阿喵手机卡</title>
<meta name="keywords" content="阿喵手机卡,流量卡,电话卡,SIM卡,大流量,联通,广电,电信" />
<meta name="description" content="正规运营商大流量卡">
<link rel="shortcut icon" href="/icon.png" type="image/x-icon">
<style>
body {
margin: 0;
padding: 0;
}
#myiframe {
width: 100%;
height: 100vh;
border: none;
}
</style>
<script>
function changeFrameHeight() {
var ifm = document.getElementById("myiframe");
ifm.height = document.documentElement.clientHeight;
}
window.onresize = function() {
changeFrameHeight();
};
</script>
</head>
<body>
<iframe src="https://simhaoka.com/phone/index?id=E8923B1D583413B6B2D2ACD8E5D4014D" id="myiframe" scrolling="yes" onload="changeFrameHeight()" frameborder="0"></iframe>
<div style="position: fixed;left: 50%;bottom: 0;transform: translate(-160px, 0px);width: 320px;text-align: center;/* background: #FFF; */margin-bottom: 5px;"><a href="https://simhaoka.com/seller" style="
display: block;
line-height: 14px;
background: #d94b49;
width: 180px;
margin: auto;
color: #FFF;
text-decoration: none;
border-radius: 5px;
padding: 5px;
font-size: 14px;
" target="_blank">代理后台登录(请先加盟)</a></div>
</body>
</html>
说明一下
以上代码实现,自动适配屏幕缩放。
无边框,带滚动
自动适配目标网址的SSL.
再最下方的iframe src=后方替换自己的目标网址即可
声明:本站为个人非盈利博客,资源均网络收集且免费分享无限制,无需登录。资源仅供测试学习,请于24小时内删除,任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集。请支持正版!如若侵犯了您的合法权益,可联系我们处理。

