-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assignment 4 - LI #12
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are close!
Nice work, but see if you can get the mydata
to get plotted by using the technique I describe in the review comments.
lab/lab2/js/part3-application.js
Outdated
console.log('done?'); | ||
}); | ||
}; | ||
console.log(mydata);//????????not defined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// its essential to define mydata out of the scope of ajax function below
var mydata;
var getAndParseData = function() {
bikedata=$.ajax(bikeCrashPhillyUrl)
.done(function(bikedata){
mydata=JSON.parse(bikedata);
console.log(mydata);
console.log('done?');
});
};
console.log(mydata);//????????not defined```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you see how I defined mydata
outside of the ajax call?
This allows the results of the ajax call to reach outside the function and save the data out in a that global scope that will persist after the function is run.
Try this again. This comes close to resolving the issue for you, but then I ran it again, and I got this error:
So youll have to define myfilter
as a function
No description provided.