0.0.5 • Published 7 years ago
zloger v0.0.5
ZLoger
A front-end log and exception statistical system
REFERENCE
<head>
<script src="zloger.js"></script>
</head>
USE
window.onerror
window.onerror = window.ZLoger.error.bind(window.ZLoger);
img.onerror / script.onerror
<img src="error.png" onerror="ZLoger.error(event)">
or
imgObj.addEventListener('error', ZLoger.error, false);
imgObj.attachEvent('onerror', ZLoger.error);
directly use send
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);
directly use reporter
ZLoger.reporter('https://www.xxx.com/pv.gif?a=c&ip=10.10.1.2', function(url) {
console.log(url);
});