不为分,帮人一忙胜造一陀大师,呵呵
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档 </title>
<script type="text/javascript">
function funLink()
{
document.getElementById("link").click();
alert("这家伙点了一次广告");
}
</script>
</head> <body>
<a id="link" href="guanggaoLink.htm"></a>
<div onclick="funLink()">广告文字</div>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档 </title>
<script type="text/javascript">
function funLink()
{
document.getElementById("link").click();
alert("这家伙点了一次广告");
}
</script>
</head> <body>
<a id="link" href="guanggaoLink.htm"></a>
<div onclick="funLink()">广告文字</div>
</body>
</html>
链接在下面
用AJAX跟踪Google Adsense广告点击-嘟嘟老窝
www.duduwolf.com/post/google_adsense_click_logger.asp
别人的广告
<div id="divAD"><!---别人的广告---->
<script type="text/javascript" src="http://country.lvyou168.cn/flashwariii/ad.js"></script></div><br/>自己的广告<br/>
<a href='http://www.lvyou168.cn'>lvyou168</a><br/>
<a href='http://country.lvyou168.cn/flashwariii/download.htm'>showbo的下载</a>
<script>if(typeof(HTMLElement)!="undefined")//ff的扩充
HTMLElement.prototype.contains=function(o){
while(o!=null){
if(o==this)return true;
o=o.parentNode;
}
return false;
}document.onclick=function(e){
var ad=document.getElementById("divAD");
e=e||event;
var o=e.srcElement||e.target;
if(ad.contains(o))alert("你点了别人的广告!");
}
</script>
<script type="text/javascript" src="http://country.lvyou168.cn/flashwariii/ad.js"> </script> </div> <br/>自己的广告 <br/>
<a href='http://www.lvyou168.cn'>lvyou168 </a> <br/>
<a href='http://country.lvyou168.cn/flashwariii/download.htm'>showbo的下载 </a>
<script> if(typeof(HTMLElement)!="undefined")//ff的扩充
HTMLElement.prototype.contains=function(o){
while(o!=null){
if(o==this)return true;
o=o.parentNode;
}
return false;
} document.onclick=function(e){
var ad=document.getElementById("divAD");
e=e||event;
var o=e.srcElement||e.target;
if(ad.contains(o))alert("你点了别人的广告!");
}
</script>
<script type="text/javascript" src="http://country.lvyou168.cn/flashwariii/ad.js"> </script> </div>
var as = document.getElementById("divAD").getElementsByTagName("a") 可以得到所以广告链接的集合for(var i=0;i<as.length;i++){
as[i].onclick = function(){
alert("你点了别人的广告");
}
}
我用了7楼的代码测试,直接用这个例子是可以的,只是我加入了自己需要引用的代码就是不行。现贴上我自己的代码
<script src='http://api.kuxun.cn/kxframe.php?w=468&h=60&p2=6&Base=jipiao4&f=other&fromid=wm9lianmeng_8614' ></script>
麻烦帮助我找一下原因