<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