When debugging JavaScript with Chrome, the "uncaught typeerror:object is not a function" appears in the console __java

Source: Internet
Author: User


Today, when developing a Web application, write a small function with Javascipt to do the following things:



That is, change the Bille coefficient, the back of my hospital accounted for automatically change. The function is very simple, with onchange= "" can be implemented, but my code is as follows:

Code 1:

     <TD width= "><input type=" text "name=" Xzgs "id="  xzgs<%=i%> "value="  <%=dlist.get (i). GETGS ()%> "   style=" width:50px; "/></td>
     <td width=" ><input type= "text" name= "Bili"  id= "bili<%=i%>"  value= "1"          onchange= "wyzb(<%=i%>);"  Style= "width:50px; "/></td>
     <td width=" ><input  type= "text" name= "Wyzb"  id="Wyzb <% =i%> "  value=" <%=dlist.get (i) Getgs ()%> "   style=" width:50px; "></input></td>
This is to call JS code, JS code is as follows:

Code 2:

<script type= "Text/javascript" src= "js/jquery.js" ></script>
<title> segment </title>
<script type= "Text/javascript" >
   function Wyzb (i) {
	   
	   var xg=new number ($ ("#xzgs" +i). Val ());
	   var bl=new number ($ ("#bili" +i). Val ());
	   var sumvalue=new number (XG*BL);
	   $ ("#wyzb" +i). attr ("value", Sumvalue);
   }
   
</script>

But the Web page just does not execute this JS code, with the Chrome debugging (review element-console) after found in "Uncaught typeerror:object is not a function".

Toss half a day to find in the call JS Code JSP page problems, such as Code 1 won the red part, onchange called the function name and the following ID duplicate, will Wyzb () function name to change it.

Related Article

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.