<a href="http://www.163.com" onclick="statOut()"/>
<a href="http://www.sina.com.cn" onclick="statOut()"/>
//在statOut函数里进行统计,可以使用AJAX
<a href="http://www.sina.com.cn" onclick="statOut()"/>
//在statOut函数里进行统计,可以使用AJAX
<script type="text/javascript"
src="http://www.test.com/page.js">
</script>里面的链接可能是不可预料的,也是不能控制的(BlueDestiny的redirect统计也是需要更改链接的)如何统计呢?
1打开你的页面的次数
-
2通过关闭window来离开页面的次数
-
3通过刷新来访问你的页面的次数
-
4其它可能
=
从你的页面链出去的次数其中,234可以忽略不计
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><body>
<a href="http://w.go.com">sdf</a>
<a href="http://w.go.com">sdf</a>
<a href="http://w.go.com">sdf</a>
<script>
var links=document.body.getElementsByTagName("a");
for(var i=0;i<=links.length;i++)
links[i].onclick=function(){alert("h");}
</script>
</body>
</html>
for(var i=0;i<links.length;i++){
links[i].attachEvent("onclick",statOut);
}function statOut(){
//ajax累计
}