1. Introduction to background knowledge Usually there are the following ways to add events to DOM elements: 1. Hard-coded form 2. Event monitoring 3. Provided by JS framework Event binding 1, hard-coded form, adopts the form of original event (Original Event). The code is similar to the following:
2, event listening mechanism, the approach adopted in this form is based on DOM event mechanism is divided into DOM standard event model addEventListener and IE event model attchEvent. The code is similar to the following:
Following the above ideas, can anyone help me write the codes for hijack code 03 and hijack code 04? Or provide other solutions? Following the above ideas, can anyone help me write the codes for hijack code 03 and hijack code 04? Or provide other solutions? 1. The existing code cannot be modified. 2. If possible, extending the original js class is also allowed. 3. func_test and not_existfunc are not known in advance and can only be obtained through "getting". 4. For the ultimate purpose, I need to know the error object, method name, event, and parameters where the error occurred. Based on this purpose, other solutions are also possible. 5. Client-side debugging tools such as firebug cannot be used. Let this type of tool tell you "the code is wrong".
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn