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

$("#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. _cdecl与_stdcall区别

    _cdecl与_stdcall是最常用的的两种函数调用修饰,区别在于函数返回时,清理栈(恢复栈平衡)是caller做还是被调函数做. : _cdecl int add1(int a, int b) : ...

  2. oracle清除归档

    清除Oracle归档日志命令echo -e 'delete noprompt archivelog ALL COMPLETED BEFORE '\'SYSDATE-${DELETE_ARCHIVELO ...

  3. 我用asp.net core 部署到docker遇到的问题

    1.怎么部署 我是用文件的形式先发布出来,然后把文件拷贝到服务器上部署到docker中去. 2.端口映射 根据查找到的资料,dockerfile 是不支持指定映射服务器端口的,只能在run的时候用-p ...

  4. 如何永久激活(破解) IntelliJ IDEA 2018.2.2

    原 如何永久激活(破解) IntelliJ IDEA 2018.2.2 版权声明:本文为博主原创文章,转载不需要博主同意,只需贴上原文链接即可. https://blog.csdn.net/zhige ...

  5. 如何规避同时使用v-if与v-for?

    先将结果过滤,再用v-if循环 遇到问题:使用Vue -computed传参数不成功, 后来将参数放在compute里面方法名里再构造参数进行传递

  6. vue 项目 使用sass以及注意事项

    vue 项目 使用sass以及注意事项 1,安装依赖: npm install node-sass --save-dev npm install sass-loader --save-dev 注: 通 ...

  7. react native Expo完全基于ScrollView实现的下拉刷新和上拉触底加载

    我直接封装成了一个组件 props参数为 static propTypes = { style:PropTypes.object, // 样式 refreshing:PropTypes.bool.is ...

  8. GradientDrawable

    一个具有渐变区域的Drawable,可以实现线性渐变,发散渐变和平铺渐变效果 核心节点:<gradient/>,有如下可选属性: startColor:渐变的起始颜色 centerColo ...

  9. tomcat配置使用log4j管理日志

    从tomcat官网下载和tomcat对应的tomcat-juli.jar和tomcat-juli-adapters.jar,从log4j官网下载log4j的jar包(我用的是log4j-1.2.17. ...

  10. c++ template Queue

    #pragma once#include <iostream>#include <iomanip> using namespace std; template<class ...