JS Listener Event Error: uncaught typeerror:xx (function name) is not a function at Htmlinputelement.onclick

Source: Internet
Author: User

Event monitoring has been error, suggesting that the defined function name is not a function, tossing a long time to think, the original is the function of the name and JS internal key words caused by the duplicate.

Have encountered this situation before, but because the probability of occurrence is relatively small, do not care too much, but this feeling really need to pay attention to, do a record.

How do you avoid naming conflicts?

1. Using anonymous functions,

2. Avoid flooding of global variables,

3. Proper use of namespaces;

4. Add the necessary annotations;

5. Avoid using keywords and reserved words.

Specific examples refer to this blog: http://blog.csdn.net/formyqianduan/article/details/52121668

      

JS Listener Event Error: uncaught typeerror:xx (function name) is not a function at Htmlinputelement.onclick

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.