网站源码中是window.clk=function(b,c,d,e,f,g,h){if(document.images){var a=encodeURIComponent||escape;(new Image).src=["/url?sa=T\x26source\x3dweb",c?"&oi="+a(c):"",d?"&cad="+a(d):"","&ct=",a(e||"res"),"&cd=",a(f),b?"&url="+a(b.replace(/#.*/,"")).replace(/\+/g,"%2B"):"","&ei=","",g].join("")}return true};
<a href="http://www.test.com" target=_blank class=l onmousedown="return clk(0,'','','res','1','')">test</a>用javascript模拟鼠标点击
if (document.URL.indexOf("aaa.com") != -1)
{
var obj = document.getElementsByTagName("a");
for (var i=0;i<obj.length;i++)
{
if(obj[i].href.indexOf("http://www.bbbb.com") != -1)
{
obj[i].onmousedown();
window.open(obj[i].href, "adWindow");
foundAd = true;
break;
}
}
}
obj[i].onmousedown();
这个来模拟 clk函数 好像不行啊 不知道错误在哪里?
<a href="http://www.test.com" target=_blank class=l onmousedown="return clk(0,'','','res','1','')">test</a>用javascript模拟鼠标点击
if (document.URL.indexOf("aaa.com") != -1)
{
var obj = document.getElementsByTagName("a");
for (var i=0;i<obj.length;i++)
{
if(obj[i].href.indexOf("http://www.bbbb.com") != -1)
{
obj[i].onmousedown();
window.open(obj[i].href, "adWindow");
foundAd = true;
break;
}
}
}
obj[i].onmousedown();
这个来模拟 clk函数 好像不行啊 不知道错误在哪里?
直接document.getElementById('id').click()就行了...