I\'m just learning about how to best organize my javascript code, and I had a question regarding this small piece of code I wrote:
var reportsControllerIndex = {
You need to use a variable reference to this outside the getJSON function. getJSON sets the context of the callback within jquery.
this
getJSON
Like this:
var self = this; $.getJSON('/reports.json', function(data) { self.plotMapPoints(data); });