第三方统计 统计方法实现
想做一个统计系统:
大概了解了一下百度统计方法,应该是用new image 做的。
我现在采用的方案也是用new image 的方法进行的
var im = "i_" + Math.floor(2147483648 * Math.random()).toString(36);
window[im] = new Image();
window[im].onload = window[im].onerror = window[im].onabort = function(){clear(this);};
window[im].src = url;
function clear(obj){
obj.onerror = null;
obj.onload = null;
obj.onabort = null;
obj = null;
}
出现的问题:发现有请求丢失 现像。求有经验的大侠指点。