问题:想通过延时把置灰的按钮再次复原,代码如下:

$("#sendEmailCode").on("click", function() {
var _this = this;
_this.setAttribute("disabled",true)
setTimeout(function(){
console.log("hh");
_this.attr("disabled",false);
}, 3000)
}

js报错:Uncaught TypeError: _this.attr is not a function

解决方案:

#源码中的调用是用jQuery作为函数的
jQuery.noConflict(); 把代码修改成
jQuery(_this).attr("disabled",false)
就不报错了。

参考文章:http://yoff.cn/article/13.html

--与君共勉

jQuery报错:Uncaught TypeError: _this.attr is not a function的更多相关文章

  1. jquery3.1.1报错Uncaught TypeError: a.indexOf is not a function

    jquery3.1.1报错Uncaught TypeError: a.indexOf is not a function 使用1.9就没有问题,解决办法: 就是把写的代码中: $(window).lo ...

  2. jQuery3.0+报错Uncaught TypeError: e.indexOf is not a function

    jQuery3.0+报错Uncaught TypeError: e.indexOf is not a function 使用.load()绑定事件时报错,Uncaught TypeError: e.i ...

  3. 使用zepto中animate报错“Uncaught TypeError: this.bind is not a function”的解决办法

    在使用zepto时,我先引入zepto.min.js,然后引入fx.js,但是在使用animate函数时,控制台却报如下错误: Uncaught TypeError: this.bind is not ...

  4. 简记webpack运行报错 Uncaught TypeError: self.postMessage is not a function

    说好2017Fix的还是能重现,可能项目的版本比较旧了,简要记录解决办法 1.错误: index.js?bed3:67 Uncaught TypeError: self.postMessage is ...

  5. jquery 报错 Uncaught TypeError: Illegal invocation

    遇到这个错误 请检查你的ajax提交方法的参数 1 参数是否都有定义 2 参数个数是否一致 3参数是否都有值(******)

  6. js报错 Uncaught TypeError: xxxx.each is not a function

    在处理ajax返回的json数组时错误的使用了 list.each(function(){ }); 实际上当遍历json数组是应该使用 $.each(list,function(index,cours ...

  7. jquery报错Uncaught ReferenceError: $ is not defined

  8. js 报错 Uncaught TypeError: Cannot read property 'trim' of undefined

    jquery Uncaught TypeError: Cannot read property 'trim' of undefined 报错原因及解决方案 $.trim() 函数用于去除字符串两端的空 ...

  9. jS Ajax 上传文件报错"Uncaught TypeError: Illegal invocation"

    使用jquery ajax异步提交文件的时候报Uncaught TypeError :Illegal invocation错误,报错信息如图: 错误原因: jQuery Ajax 上传文件处理方式,使 ...

随机推荐

  1. 安装包设计-------安装(QT)---------知识总结

    1.判断文件是否存在 QFile file(path): file.exists(); 2.复制文件 bool copy(const QString &fileName, const QStr ...

  2. 我好菜系列——map查找

    链接:https://ac.nowcoder.com/acm/contest/931/A来源:牛客网 DNA序列里只有ACGT四种字母,A和T对应,C和G对应. 俩序列完全对应,就是指它们每一位上的字 ...

  3. Echarts——关系图(人民的名义为例,简化)源码

    参考博文:https://www.cnblogs.com/emrys5/p/echart-relationship-map.html <!DOCTYPE html> <html> ...

  4. HDU 4374 One hundred layer(单调队列DP)

    题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=116242#problem/E 题意:差不多就是男人勇下百层的游戏.从第一层到最 ...

  5. ICEM-圆环孔

    原视频下载地址:https://yunpan.cn/cSKwAIRmFLGe5  访问密码 49c5

  6. Ubuntu JDK环境变量

    环境变量配置 sudo gedit ~/.bashrc export JAVA_HOME=/usr/local/java/jdk1.8.0_201 export JRE_HOME=${JAVA_HOM ...

  7. How to appraise Hearthstone card values

    https://elie.net/blog/hearthstone/how-to-appraise-hearthstone-card-values/ In 2014, I became an avid ...

  8. mysqldump定时任务生成备份文件内容为空解决方法

    1问题:写好了一个mysqldump备份脚本(如图)直接执行可以正常生成备份文件,但在用crontab运行时却生成内容为空 2原因分析:由于mysqldump存在于全局环境变量mysql的bin下面, ...

  9. 如何单独编译Linux内核的某个模块?

    1. 配置该模块为[M] 2. 编译 make modules SUBDIRS=./drivers/rtc (5.3的内核为make modules M=./drivers/rtc) 3. 安装 ma ...

  10. (翻译) closures-are-not-complicated

    总计:读完这篇文章需要20分钟   这篇文章讲解了闭包的一些内容,作者是拿ES5规范中的一些名词来讲的. 所以可能和博客上一篇文章中提到的binding object, (lexical enviro ...