I have this bit of Coffeescript
d3Graph: =>
refreshData: ->
console.log "refresh data called"
someButton.click ->
refreshData()
When I click “someButton” I receive an error
Uncaught ReferenceError: refreshData is not defined
Anyone see my error?
Try using
refreshData =instead ofrefreshData:here.If that doesn’t work, you’ll have to provide more complete code.
If you run into problems like this, it’s always helpful to see what the output JavaScript is.
For instance, in this case, your original code outputs:
So it should be apparent that there is no variable/function called
refreshData!