我想调整窗口大小时调用几个函数。 changePosition函数被调用的很好,但tryPrint函数受到“Uncaught TypeError:Object [object global]”没有方法'tryPrint'“错误的困扰。我不明白为什么会这样。我尝试添加一个“这个”参数将调整大小的监听器,但没有导致我在任何地方......从其他函数调用Backbone视图函数的问题
class App.Views.Pages.WorkView extends Backbone.View
template: JST["backbone/templates/pages/work"]
initialize:() ->
this.render()
$(window).on('resize', this.changePosition)
tryPrint: ->
console.log("TRYING")
changePosition: ->
this.tryPrint()
render: =>
$(@el).html(@template())
return this
我根本不知道胖箭头有什么不同。对此,我真的非常感激! – user2245942