我想調整窗口大小時調用幾個函數。 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