萬盛學電腦網

 萬盛學電腦網 >> 腳本專題 >> javascript >> js通過iframe加載外部網頁的實現代碼

js通過iframe加載外部網頁的實現代碼

 今天從別的網站看到的,不需要跳轉到別的頁面直接本域名下調用外部網頁。裡面用js控制iframe的大小,確實不錯。

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 <!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.jb51.net</title> <meta name="keywords" content="腳本之家,腳本之家_www.jb51.net" /> <meta name="description" content="腳本之家相關信息,腳本之家_www.jb51.net" /> <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.jb51.net/index.htm" style=" height:500px; visibility: inherit; width: 100%; z-index: 1;overflow: visible;"></iframe> <div style="display:none"> © <a href="http://so.jb51.net/">好搜網</a> <a href="http://so.jb51.net/" target="_blank">最好的搜索引擎</a> 以上搜索結果由<a href="http://so.jb51.net/" target="_blank">百度</a>驅動 </div> </body></html>
copyright © 萬盛學電腦網 all rights reserved