学习一下山西联通的流氓代码
作者:admin 日期:2012-10-02
主要是实现Iframe框架自适应窗口高度的javascript代码:
XML/HTML代码
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>无标题文档</title>
- </head>
- <body style="margin:0;padding:0; height:100%" scroll=no>
- <!--用户原访问地址-->
- <iframe id="content" name="content" src="http://www.qq.com/?QL7VK9PcHH=2lIixFsDw2" marginwidth="0" marginheight="0" frameborder="0" width="100%" height="100%" >
- </iframe>
- <!--自动适应高度脚本 解决IE7不能适应问题-->
- <script language="javascript">
- var Sys = {};
- var ua = navigator.userAgent.toLowerCase();
- var s;
- (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
- (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
- (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
- (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
- (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
- function autoheight(sid) {
- var gid=document.getElementById(sid);
- gid.height=document.documentElement.offsetHeight-5;
- }
- if(Sys.ie)
- {
- if(parseFloat(Sys.ie)<9)
- {
- window.setInterval("autoheight(\"content\")",100);
- }
- }
- // window.setInterval("autoheight(\"content\")",100);
- </script>
- <!--插入广告脚本-->
- <script src="js/ad-03.js" language="JavaScript"></script>
- <script type="text/javascript">
- var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
- document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F8bb7a0dabf88a82b478f65a1152b9680' type='text/javascript'%3E%3C/script%3E"));
- </script>
- </body>
- </html>
流氓网址:http://www.kdly.net/tuisong/lt120606/
评论: 0 | 引用: 0 | 查看次数: 1911
发表评论
广告位