Google Chrome uncaught typeerror:object is not a function

Source: Internet
Author: User

<script type= "Text/javascript" >
function Testform () {
Alert ("Hello World!");
}
</script>
<body>
<form name= "testform" action= "" >
<input type= "button" onclick= "testform()" value= "Submit"/>
</form>
</body>

A bug in Chrome was discovered today when debugging a program using Google Chrome. Said big, but very irritating. It took a good while to find out the cause of the mistake.

The program source code is as shown above.

When you click the button again, the Ie,firefox can be displayed as a cue box "Hello World!". But that's not chrome.

In fact, the problem is in the Code Red two of the same name part. As long as these two parts do not have the same name, the program can run normally.

To avoid such a problem. In the Name,id,class property for an element, try not to have the same name as the function names in the script, or the same name as the intrinsic event names of the page elements, such as OnClick, onkeydown.

Google Chrome uncaught typeerror:object is not a function

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.