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

$("#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

--与君共勉

最新文章

  1. 120项改进:开源超级爬虫Hawk 2.0 重磅发布!
  2. js获取HTTP的请求头信息
  3. Android Studio导入第三方jar包
  4. 转:MVC 数据验证
  5. 使用Python 将shapefile导入mongodb
  6. 转:LAV Filter 源代码分析
  7. 这五个题你懂了javascript你就入门了
  8. Mysql 锁粒度
  9. python列表和QVariant
  10. javascript动画效果之多物体缓冲运动
  11. Spring 4.2.5 + Quartz 2.2.0整合
  12. c# Winform Invoke 的用法
  13. [android]__如何在studio中导入,使用开源的UI组件
  14. Json.net 反序列化 部分对象
  15. python 自然语言处理(四)____词典资源
  16. 使用mysqldump备份时为什么要加上 -q 参数(5.7默认为on)
  17. Java中classpath配置
  18. Linux 系统学习梳理_【All】
  19. Windows 视频Directshow开发介绍
  20. 1-[并发编程]-操作系统OS

热门文章

  1. idea 启动 Error running 'XxGatewayApplication': Command line is too long. Shorten command line for XxGatewayApplication or also for Spring Boot default
  2. AI 期刊会议
  3. 超大地图MMORPG的场景管理
  4. MongoDB-查询关键字/排序等
  5. js中两个感叹号的原理与用法分析
  6. sqlserver 锁表进程及执行的SQL
  7. unigui图形验证码
  8. MySQL索引选择及添加原则
  9. Thymeleaf th:include、th:replace引用
  10. otter安装、使用