Giter VIP home page Giter VIP logo

monitorfe's Issues

建议代理XMLHttpRequest,而不是新建一个xhr构造函数

代码是通过新建一个函数,然后返回一个xhr实例。

这样导致的问题是访问不到原生XMLHttpRequest函数上的一些属性。例如:
image

建议使用代理的方式,让新建的构造函数也能访问到原生XMLHttpRequest函数上的属性

IE 9之前不支持 addEventListener

addEventListener 支持仅到 IE9,IE 9之前可以使用 attachEvent 来替代做兼容。


// IE 9
window.addEventListener("error", function(err) {})

// IE 8
window.attachEvent("onerror", function(err) {})

SDK 无法捕获 TypeError 错误

SDK 无法监控 TypeError 错误

使用 addEventListener 在 window 上无法监听到 TypeError 类型的错误。

1.无法捕捉到 JS 语法错误。

var test =document.getElementsByClassName("test")[0]; // test = undefined
test..onclick = function () {}; // Uncaught TypeError: Cannot set property 'onclick' of undefined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.