Today feedback a bug, said a page function can not be used. Open the console and find an error: object is not a function.
It feels strange that the function of this piece has not been moved, how could it suddenly go wrong? The mainstream browser has been tested in the online.
Although strange, but still solve the problem. Look at the code that finds a radio object with the Name property and a function name duplicate. The code is as follows:
<body>
<input type= "Radio" name= "Test" onclick= "Test ();" />
<br/>
<form action= "> <input type=" Radio "name="
test "onclick=" Test (); " />
</form>
</body>
<script type= "text/javascript" >
function Test () {
Alert ("one");
}
</script>
The function name was modified to solve the problem. But there is no root cause, because this function is the same as before, it can be used normally. Modify Code
onclick= "alert (test);"
Discovery pops up "Object Htmlinputelement" and the browser resolves test to become a DOM object.
Alert (test) After the script test function, or a function.
Looking at the SVN version found that I was doing another function when I added the form form to wrap this radio up. Error causing browser parsing.
Summary: Not necessarily unchanged code is no problem, perhaps the change of place caused by other problems. Some browser compatibility problems are caused by code is not standardized, later write code to be standardized!
Daniel, if you know why you added the form browser to parse the problem, tell me. Appreciate!