JavaScript compatibility in Event monitoring summary _javascript Tips

Source: Internet
Author: User
Tags event listener
1,ie uses the Attachevent/detachevent method to add and remove event listeners, and the Addeventlistener/removeeventlistener method is used by the consortium.

2,ie uses the OnEvent naming method for its events, and the consortium is the name of the event.

The 3,ie event Listener uses a global event object, which is passed as an argument to the listener by the consortium.

4, in order to avoid triggering the default event behavior, IE's practice is to require the programmer to set the ReturnValue property value in the event object to False, and the practice of the consortium is to execute the Preventdefault method.

5,ie does not provide support for the event capture phase.

6, to stop the delivery of events, IE's practice is to set the event object's cancelbubble to true, and the practice of the consortium is to set the execution Stoppropagation method.

7,ie the event listener as a separate function, which is invoked as an object's method, which means that in IE the this keyword in the event listener points not to an event occurrence object but to a useless global object (Window object).

8,ie There is a memory leak problem with the event listener. In IE Explorer, if you want to create an event listener for an element and use that element in the listener, the memory space occupied by the listener and the associated DOM nodes is not freed until the user enters another page.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.