Skip to content
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

API Issues with Local Server and GET REQUEST using Javascript and JQuery #221

Closed
dab65068 opened this issue May 9, 2017 · 2 comments
Closed

Comments

@dab65068
Copy link

dab65068 commented May 9, 2017

Hi,
I am a graduate student enrolled in a Web-Mapping Course. As part of my course syllabus, I am supposed to submit a final project. I want to use the Yelp Fusion API to display local businesses within a 0.25 mile radius from train stations I have added as a GeoJSON. I have successfully used your API in Postman to retrieve data on businesses to test if my access token works, however, when I try to use ajax to get businesses in my JavaScript I get this error.
image
Here is a sample of my code using ajax.
image 2

Is there any reason why I am getting this issue? I read various forums and I keep hearing the term CORS, which I somewhat understand what it mean, and not being able to send my request because my map comes from a local server, my C drive. Is there a way around this? I just want to use this API for my class and my project is due Thursday. I may need to change it if I can't resolve this issue by Wednesday morning

P.S. this is my first class using a programming language. While I do enjoy it and want to learn other languages, I may not be as familiar with terms or techniques as others here.

Thanks!

@tomelm
Copy link
Contributor

tomelm commented May 11, 2017

Hey @dab65068! At the moment, the API does not fulfill any requests that come in through AJAX. CORS is a concept that covers making requests across different sites, and we currently have that completely disabled for the API. Sorry about that!

@mittonk
Copy link
Contributor

mittonk commented Jun 6, 2017

CORS discussions in #44 and #64 capture the current state of affairs; the best option right now is writing a small backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants