在coffeescript中使用$(this)
Using $(this) in coffeescript
本文关键字:this coffeescript 更新时间:2023-09-26
就一个。如何在Coffeescript中使用jQuery $(this)
:
$ 'input'
.on 'click', (e) ->
alert 'test' if $ 'this'
.is(':checked')
不能让它工作
$('input').on('click',
(e) ->
if $(this).is(':checked')
alert('test')
)
':checked'
not :checked
使用括号-这将节省你的时间。相信我。
相关文章:
- $(this).prop('property') vs. this.property
- Twitter Bootstrap typeahead:使用“this”获取上下文/调用元素
- 在另一个函数中使用变量this
- this.router在AngularJS 2中未定义
- reactjs this.refs vs document.getElementById
- JavaScript 中的嵌套函数和 “this” 关键字
- React+Meteor:this.ops返回未定义
- javascript中对象构造函数中的var属性与this.properties
- 函数中this和var之间的区别
- jQuery(this).Pparent().Pparente().Prent().find()在iPad上不起作用
- Understanding Javascript scope with "var that = this&qu
- 在方法中的函数中引用 CoffeeScript 类中的“this”的最佳方式是什么?
- d3.js/CoffeeScript:访问mouseover中类和路径的执行上下文(this)
- 未捕获类型错误:this.source不是函数coffeescript错误
- 如何在CoffeeScript或JavaScript中从基类(this. constructor .name)中引用扩展
- Coffeescript - 'this'总是被'_this'在胖箭头回调
- Foreach循环链接到'this'CoffeeScript
- Coffeescript 'this' inside jQuery .each()
- jQuery / Coffeescript隐藏除$(this)之外的相关名称,不允许我勾选选择框
- 在coffeescript中使用$(this)