Skip to content

Instantly share code, notes, and snippets.

@zenxds zenxds/打点.js
Created Jan 20, 2015

Embed
What would you like to do?
function log(url, callback) {
// 防止请求被垃圾回收
var image = new Image(),
id = "_tbtx_" + Math.random();
window[id] = image;
image.onload = image.onerror = function() {
window[id] = null;
if (callback) {
callback();
}
};
image.src = url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.