今天从别的网站看到的,不需要跳转到别的页面直接本域名下调用外部网页。里面用js控制iframe的大小,确实不错。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>脚本之家_www.uoften.com</title>
<meta name="keywords" content="脚本之家,脚本之家_www.uoften.com" />
<meta name="description" content="脚本之家相关信息,脚本之家_www.uoften.com" />
<link rel="shortcut icon" type="image/x-icon" href="./favicon.ico">
<link href="images/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript">
window.onerror=function(){return true;}
$(function() {
headerH = 0; var h = $(window).height();
$("#huoduan_frame").height((h-headerH)+"px");
});
</script>
<!--[if IE 6]>
<script type="text/javascript" src="js/DDPNG.js"></script>
<script type="text/javascript">
DD_belatedPNG.fix('.png');
</script><![endif]-->
</head>
<body scroll="no" style="margin:0; padding:0; overflow-y:hidden ">
<iframe id="huoduan_frame" frameborder="0" scrolling="yes" name="main" src="http://www.uoften.com/index.htm" style=" height:500px; visibility: inherit; width: 100%; z-index: 1;overflow: visible;"></iframe>
<div style="display:none">
© <a href="http://so.uoften.com/">好搜网</a> <a href="http://so.uoften.com/" target="_blank">最好的搜索引擎</a> 以上搜索结果由<a href="http://so.uoften.com/" target="_blank">百度</a>驱动 </div>
</body></html>
脚本之家小编注: 里面使用了jquery。
最后
以上就是多情背包最近收集整理的关于js通过iframe加载外部网页的实现代码的全部内容,更多相关js通过iframe加载外部网页内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复