南京电信这几天几乎天天推送广告,手法简单粗暴,不知道效果如何,我是要换移动宽带了。
页面源代码:
| <!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> | |
| <style type="text/css"> | |
| <!– | |
| td { | |
| font-family: Verdana, "宋体"; | |
| font-size: 11px; | |
| line-height: 180%; | |
| color: #333333; | |
| } | |
| a { | |
| color: #333333; | |
| text-decoration: none; | |
| } | |
| –> | |
| </style> | |
| </head> | |
| <body style="margin:0;padding:0; height:100%" scroll=no> | |
| <!–用户原访问地址–> | |
| <iframe id="content" name="content" src="http://hsining.com/info/?GBxMB0GS87=sb8Zn5i4mr" marginwidth="0" marginheight="0" frameborder="0" width="100%" height="100%" > | |
| </iframe> | |
| <!–自动适应高度脚本 解决IE7不能适应问题–> | |
| <script language="javascript"> | |
| function autoheight(sid) { | |
| var gid=document.getElementById(sid); | |
| gid.height=document.documentElement.offsetHeight-5; | |
| } | |
| window.setInterval("autoheight(\"content\")",100); | |
| </script> | |
| <!–插入广告脚本–> | |
| <script src="js/up.js" language="JavaScript"></script> | |
| </body> | |
| </html> |
JS代码:
window.onload = getMsg; window.onresize = resizeDiv; window.onerror = function(){} //提示使用 var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0; function getMsg() { try{ divTop = parseInt(document.getElementById("jiezp").style.top,10) divLeft = parseInt(document.getElementById("jiezp").style.left,10) divHeight = parseInt(document.getElementById("jiezp").offsetHeight,10) divWidth = parseInt(document.getElementById("jiezp").offsetWidth,10) docWidth = document.body.clientWidth; docHeight = document.body.clientHeight; document.getElementById("jiezp").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight document.getElementById("jiezp").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth document.getElementById("jiezp").style.visibility="visible" objTimer = window.setInterval("moveDiv()",10) } catch(e){} } function resizeDiv() { i+=1 if(i>10000) closeDiv() //客户想不用自动消失由用户来自己关闭所以屏蔽这句 try{ divHeight = parseInt(document.getElementById("jiezp").offsetHeight,10) divWidth = parseInt(document.getElementById("jiezp").offsetWidth,10) docWidth = document.body.clientWidth; docHeight = document.body.clientHeight; document.getElementById("jiezp").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10) document.getElementById("jiezp").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10) } catch(e){} } function moveDiv() { try { if(parseInt(document.getElementById("jiezp").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10))) { window.clearInterval(objTimer) objTimer = window.setInterval("resizeDiv()",1) } divTop = parseInt(document.getElementById("jiezp").style.top,10) document.getElementById("jiezp").style.top = divTop - 3 } catch(e){} } function closeDiv() { document.getElementById('jiezp').style.visibility='hidden'; if(objTimer) window.clearInterval(objTimer) } document.writeln("<DIV id=jiezp style=\"Z-INDEX:3; LEFT: 0px; VISIBILITY: hidden; WIDTH: 352px; POSITION: absolute; TOP: 0px; HEIGHT: 250px\">");document.writeln("<table width=\"352\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" style=\"border-width:1px; border-style:solid; border-color:#cccccc\">");document.writeln("<tr>");document.writeln("<td width=\"342\" align=\"right\"><img src=\"images\/close.jpg\" width=\"43\" height=\"15\" border=\"0\" onClick=closeDiv() style=\"cursor:pointer\"><\/td>");document.writeln("<\/tr>");document.writeln("<tr>");document.writeln("<td align=\"center\">");document.writeln("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td align=\"center\"><a href=\"http:\/\/enjoy.js.vnet.cn\/china60\/\" width=\"344\" height=\"251\" border=\"0\" target=\"_blank\"><img src=\"http:\/\/www1.js.vnet.cn\/push\/0909\/60y\/images\/60.jpg\" width=\"344\" height=\"251\" border=\"0\" ></a><\/td><\/tr><\/table>");document.writeln("<\/td><\/tr><\/table>");document.writeln("<\/DIV>");
Tags: push 南京电信
主要是直接用Iframe包含目标页面会导致有些网站弹出警告提示,用户体验很差