【异常】$ is not defined (已解决)

简介: $ is not defined (已解决),F12调试页面Console错误提示

F12调试页面Console错误提示


因为一个项目要引用utils,而且utils里用到了JQuery,所以提示$未定义,两个JS引入顺序反了

错误写法如下:

<scriptsrc="/www/xgwy_m/js/utils/utils.js"></script><scriptsrc="/js/jquery_lazyload-1.7.2/jquery.lazyload.min.js"></script><script>functioncheckArea() {
varareaSize=$('#area').val();
if (utils.checkInt(areaSize)) {
if (areaSize.length>10){
$('#area').val("");
            }
        }
    }
</script>

应该修改为

<scriptsrc="/js/jquery_lazyload-1.7.2/jquery.lazyload.min.js"></script><scriptsrc="/www/xgwy_m/js/utils/utils.js"></script><script>functioncheckArea() {
varareaSize=$('#area').val();
if (utils.checkInt(areaSize)) {
if (areaSize.length>10){
$('#area').val("");
            }
        }
    }
</script>

修改过后就不再报错了。


本文首发于CSDN,为博主原创文章,如果需要转载,请注明出处,谢谢!


完结!

目录
打赏
0
0
0
0
17
分享
相关文章
成功解决:Error in created hook: “ReferenceError: params is not defined“
该博客文章描述了作者解决"ReferenceError: params is not defined"错误的过程,原因是路由传递的params参数与调用方法中的参数名称冲突,最终通过检查接口参数解决了问题。
成功解决:Error in created hook: “ReferenceError: params is not defined“
|
10月前
|
单步调试报错 Thread 1: EXC_BAD_ACCESS (code=1, address=0x6565656565)
单步调试报错 Thread 1: EXC_BAD_ACCESS (code=1, address=0x6565656565)
172 0
成功解决FATAL ERROR in native method: JDWP on getting class status, jvmtiError=JVMTI_ERROR_WRONG_PHASE
成功解决FATAL ERROR in native method: JDWP on getting class status, jvmtiError=JVMTI_ERROR_WRONG_PHASE
小程序报错-ReferenceError: regeneratorRuntime is not defined
小程序报错-ReferenceError: regeneratorRuntime is not defined
146 0
【Java异常】ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2 JDWP exit erro
【Java异常】ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2 JDWP exit erro
403 0
Pyrsgis:执行imageChipsFromFile报错NameError: name ‘copy‘ is not defined
Pyrsgis:执行imageChipsFromFile报错NameError: name ‘copy‘ is not defined
286 0
【异常】This application has no explicit mapping for /error, so you are seeing this as a fallback的解决方法
This application has no explicit mapping for /error, so you are seeing this as a fallback的解决方法
5329 0
【异常】This application has no explicit mapping for /error, so you are seeing this as a fallback的解决方法
Bad method handle type 7异常解决
在利用androidx版本写demo时,在添加了一些依赖后,遇到了`java.lang.ClassNotFoundException`bug,这就很奇怪了,我就添加rxjava3的依赖,就给我报这个错误。
报错__wxConfig is not defined
报错__wxConfig is not defined
334 0
报错__wxConfig is not defined
addHeaderView()异常 —— setAdapter has already been called
addHeaderView()异常 —— setAdapter has already been called
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等