A front-end log and exception statistical system
<head>
<script src="zloger.js"></script>
</head>
window.onerror = window.ZLoger.error.bind(window.ZLoger);
<img src="error.png" onerror="ZLoger.error(event)">
or
imgObj.addEventListener('error', ZLoger.error, false);
imgObj.attachEvent('onerror', ZLoger.error);
ZLoger.send('http://aa.xx.com/pv.gif?', {
ip: '10.1.1.1'
}, 1);
or
ZLoger.send('http://aa.xx.com/pv.gif?name=benjamin', {
ip: '10.1.1.1'
}, 0.3);
ZLoger.reporter('https://www.xxx.com/pv.gif?a=c&ip=10.10.1.2', function(url) {
console.log(url);
});