<script type='text/javascript'>
function htmlspecialchars(str){
str = str.replace(/</g, '<');
str = str.replace(/>/g, '>');
str = str.replace(/"/g, '"');
str = str.replace(/'/g, ''');
return str;
}
function bol(){
var inf = (top.location!=self.location);
var qs = location.search.split("?")[location.search.split("?").length-1].split("&");
qso = {};
for(var i=0;i<qs.length;i++){
if(qs[i]=="")continue;
var tmpa = qs[i].split("=");
qso[tmpa[0]] = tmpa[1]?tmpa[1]:"";
}
var tu = unescape(qso.tu);
if(htmlspecialchars(tu).length != tu.length){
exit;
}
if(inf){
var oi = document.createElement("iframe");
oi.id="iobj"
oi.border=0;
oi.frameBorder=0;
oi.style.height="1px"
oi.style.width="1px"
document.body.appendChild(oi);
var cd = oi.contentWindow.document;
cd.write('<ht'+'ml><bo'+'dy style="margin:0px;padding:0px"></scr'+'ipt><scr'+'ipt src="http://js.tongji.linezing.com/1023331/tongji.js" type="text/javascript"></scr'+'ipt><noscr'+'ipt><a href="http://www.linezing.com"><img src="http://img.tongji.linezing.com/1023331/tongji.gif"/></a></noscr'+'ipt></bo'+'dy></ht'+'ml>');
window.setTimeout(function(){cd.close();if(qso.tu)location.href = unescape(qso.tu);},1000);
}else{
if(qso.co&&qso.co!=""){
document.cookie="tk_trace="+(qso.co)+";path=/;domain=.taobao.com";
}
if(qso.tu && (qso.tu.indexOf("http%3A%2F%2Fs.click.taobao.com%2F")===0 || qso.tu.indexOf("http%3A%2F%2Fs.click.alimama.com%2F")===0
|| qso.tu.indexOf("http%3A%2F%2Fitem8.taobao.com%2F")===0 || qso.tu.indexOf("http%3A%2F%2Fshop8.taobao.com%2F")===0)){
if(!window.attachEvent){
document.write('<input style="display:none" type="button" id="exe" value="" onclick="window.location=\''+unescape(qso.tu)+'\'">');
document.getElementById('exe').click();
}else{
document.write('<a style="display:none" href="'+unescape(qso.tu)+'" id="exe"></a>');
document.getElementById('exe').click();
}
}
}
}//end of bol()
bol();
</script>
function htmlspecialchars(str){
str = str.replace(/</g, '<');
str = str.replace(/>/g, '>');
str = str.replace(/"/g, '"');
str = str.replace(/'/g, ''');
return str;
}
function bol(){
var inf = (top.location!=self.location);
var qs = location.search.split("?")[location.search.split("?").length-1].split("&");
qso = {};
for(var i=0;i<qs.length;i++){
if(qs[i]=="")continue;
var tmpa = qs[i].split("=");
qso[tmpa[0]] = tmpa[1]?tmpa[1]:"";
}
var tu = unescape(qso.tu);
if(htmlspecialchars(tu).length != tu.length){
exit;
}
if(inf){
var oi = document.createElement("iframe");
oi.id="iobj"
oi.border=0;
oi.frameBorder=0;
oi.style.height="1px"
oi.style.width="1px"
document.body.appendChild(oi);
var cd = oi.contentWindow.document;
cd.write('<ht'+'ml><bo'+'dy style="margin:0px;padding:0px"></scr'+'ipt><scr'+'ipt src="http://js.tongji.linezing.com/1023331/tongji.js" type="text/javascript"></scr'+'ipt><noscr'+'ipt><a href="http://www.linezing.com"><img src="http://img.tongji.linezing.com/1023331/tongji.gif"/></a></noscr'+'ipt></bo'+'dy></ht'+'ml>');
window.setTimeout(function(){cd.close();if(qso.tu)location.href = unescape(qso.tu);},1000);
}else{
if(qso.co&&qso.co!=""){
document.cookie="tk_trace="+(qso.co)+";path=/;domain=.taobao.com";
}
if(qso.tu && (qso.tu.indexOf("http%3A%2F%2Fs.click.taobao.com%2F")===0 || qso.tu.indexOf("http%3A%2F%2Fs.click.alimama.com%2F")===0
|| qso.tu.indexOf("http%3A%2F%2Fitem8.taobao.com%2F")===0 || qso.tu.indexOf("http%3A%2F%2Fshop8.taobao.com%2F")===0)){
if(!window.attachEvent){
document.write('<input style="display:none" type="button" id="exe" value="" onclick="window.location=\''+unescape(qso.tu)+'\'">');
document.getElementById('exe').click();
}else{
document.write('<a style="display:none" href="'+unescape(qso.tu)+'" id="exe"></a>');
document.getElementById('exe').click();
}
}
}
}//end of bol()
bol();
</script>
解决方案 »
- jquery如何让动态加载的内容也能受到页面加载时的代码影响?
- dreamweaver,javascript,access,图片
- 考试系统中,如何实现规定考试时间
- 引入js文件出错
- 在JavaScript中有等价于ASP中Response.End的语句吗?
- 寻求一段关于鼠标复制的代码
- 我用jplayer做的播放器不兼容ie
- 怎样在self.close()时不弹出提示对话框,直接关闭窗口
- javascript的chm版帮助文件
- 为什么窗口关闭了还在运行后面的代码?我想窗口关闭就不再运行后面的代码,怎么办?
- input onkeyup 弹出 div+table 的数据列表后,操作很卡
- 采集js动态网页数据的问题
inf 是判断本网页是否被框架
qso主要是把连接地址中的参数分割,组成对象,下面调用。
........
如果被框架,本页就重写HTML,内容是 cd.write(".....") 并一秒钟后转到unescape(qso.tu)
否则,根据情况写入cookie
生成链接,自动点击,同样跳转到unescape(qso.tu)
=========大概就是这样