在用chrome调试JavaScript时,在console中出现“uncaught TypeError: Object is not a function”
来源:互联网 发布:微信购物商城源码 编辑:程序博客网 时间:2024/05/17 23:00
今天在开发web程序时,用javascipt写了一个小函数,想用来做如下事情:
即,改变比列系数时,后面的我院占比自动改变。函数很简单,用onchange=“”就可以实现了,但我的代码如下:
代码1:
<td width="60" ><input type="text" name="xzgs" id="xzgs<%=i%>" value="<%=dlist.get(i).getGs()%>" style="width:50px; "/></td> <td width="60"><input type="text" name="bili" id="bili<%=i%>" value="1" onchange="wyzb(<%=i%>);" style="width:50px; "/></td> <td width="60"><input type="text" name="wyzb" id="wyzb<%=i%>" value="<%=dlist.get(i).getGs()%>" style="width:50px; "></input></td>
这是要调用JS 的代码,JS代码如下:代码2:
<script type="text/javascript" src="js/jquery.js"></script><title>环节细分</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>
但是网页就是不执行这个js代码,用chrome调试(审查元素-console中)后发现在”uncaught TypeError: Object is not a function“。
折腾半天才发现在调用JS代码的jsp页面中出问题,如代码1中标红的部分,onchange调用的函数名与下面的id重名了,将wyzb()函数名改一下就可以了。
- 在用chrome调试JavaScript时,在console中出现“uncaught TypeError: Object is not a function”
- chrome浏览器Uncaught TypeError: object is not a function问题
- chrome浏览器Uncaught TypeError: object is not a function问题解决
- chrome浏览器Uncaught TypeError: object is not a function问题
- Sea.js出现Uncaught TypeError: object is not a function
- Uncaught TypeError: object is not a function
- Uncaught TypeError: object is not a function
- html在chrome浏览器中调试报错: object is not a function问题解决
- Uncaught TypeError: object is not a function的解决方法
- Sea.js出现Uncaught TypeError: object is not a function的解决方法
- javascript 错误 "Uncaught TypeError: string is not a function"
- javascript 错误 "Uncaught TypeError: string is not a function"
- Uncaught TypeError: undefined is not a function
- Uncaught TypeError: string is not a function
- Uncaught TypeError: undefined is not a function
- Uncaught TypeError: undefined is not a function
- Uncaught TypeError: boolean is not a function
- Uncaught TypeError: $(...).appendChild is not a function
- 正则表达式之限定符
- Android实现登录界面记住用户名与密码
- spring-aop
- 【黑马程序员】SqlHelper+三层架构 +例子1)复习创建客户和三层的知识+、(例子2)项目初始框架(HRMSys)
- VNC远程桌面的配置及启动
- 在用chrome调试JavaScript时,在console中出现“uncaught TypeError: Object is not a function”
- mybatis + spring 多数据源跨库查询
- NS3学习第一阶段---运行NS3实例
- Ubuntu 11.04 下安装配置 JDK 7
- 我的linux学习9 linux的帐号与身份管理
- 利用jquery的imgAreaSelect插件实现图片裁剪示例
- 10 DatePicker
- php禁止单IP、IP段访问的实现代码
- 嵌入式软件工程师经典笔试题