Uncaught TypeError: XXX is not a function
程序员文章站
2022-04-28 18:31:34
...
前端一直报 Uncaught TypeError: online is not a function
的错误
代码如下
<ul class="am-nav am-nav-tabs am-nav-justify" style="font-size: 14px;">
<li>
<a href="#" id="online" onclick="online()">本组在线</a>
</li>
<li>
<a href="#" id="inclass" onclick="inclass()">班内战况</a>
</li>
<li>
<a href="#" id="classwar" onclick="classwar()">班级战况</a>
</li>
</ul>
后来才发现原因是因为ID和函数名重名了,修改其中一个就可以了。
推荐阅读
-
Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object
-
Ajax方式上传文件报错"Uncaught TypeError: Illegal invocation"
-
d3.svg.line()错误:TypeError: d3.svg.line is not a function
-
Vue 报错TypeError: this.$set is not a function 的解决方法
-
WxParse:thirdScriptError undefined;at xxx/xxx/xxx onLoad function;at api request success callback报错的解决办法
-
UnhandledPromiseRejectionWarning: TypeError: loaderContext.getResolve is not a function
-
Extjs4---Uncaught TypeError: Cannot read property ‘items’ of undefined
-
jQuery的$.get()函数不执行以及php端报错Uncaught Error: Call to a member function bind_param() on boolean in...
-
JavaScript Uncaught TypeError: Cannot read property 'value' of null
-
Xcode解决“Implicit declaration of function 'XXX' is invalid in C99” 警告或报错