广告类iframe嵌套页面框架网页
有用户需求这里做个代码记录:
<script> $(function() { if (!performance.navigation.type) { $("body").prepend('<div align="center" style="width:100%;max-width:100%;z-index:10000" id="div_iframe"><iframe id="bi_iframe" frameborder="0" width="100%" height="1000" frameborder="0" scrolling="no" src="https://www.58xp.com/" onload="adjustIframe();"></iframe></div>'); } }); function adjustIframe(){ var ifm= document.getElementById("bi_iframe"); ifm.width=document.getElementById("div_iframe").clientWidth; } </script>
替换网页标题与内容:
<script> $(function() { document.title='老阳插件'; $("body").html('<div align="center" style="width:100%;max-width:100%;z-index:10000" id="div_iframe"><iframe id="bi_iframe" frameborder="0" width="100%" height="1000" frameborder="0" scrolling="no" src="https://www.58xp.com/" onload="adjustIframe();"></iframe></div>'); function adjustIframe(){var ifm= document.getElementById("bi_iframe");ifm.width=document.getElementById("div_iframe").clientWidth;}}); </script>
JS处理显示404错误页:
<script> $(function() { $('title').html('404 Not Found'); $('body').html('<!DOCTYPE html><html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>404</title><style> * { max-width: initial !important; } </style></head><body style="margin: 0;padding: 0;"><center><h1>404 Not Found</h1></center><hr><center>nginx</center></body></html>'); }); </script>
复制全文
导出文档
打赏作者
《广告类iframe嵌套页面框架网页》.doc
将本文下载保存,方便收藏和打印
导出文档