propublica / Capitol-Words

Scraping, parsing and indexing the daily Congressional Record to support phrase search over time, and by legislator and date
BSD 3-Clause "New" or "Revised" License
122 stars 34 forks source link

JSONP and CORS Issues #85

Open johnalexhall85 opened 10 years ago

johnalexhall85 commented 10 years ago

Hi Guys,

I'm having two issues with the Capitol Words API using AngularJS. The first is that when I add a callback, ex. callback=JSON_CALLBACK, I get and error that it is undefined. Normally, I would assume it was an error on my part and move on, but it works perfectly with the Congress API.

So after a while I tried to enable CORS and use $http.get to retrieve the data, but I get an access is denied. Am I doing something wrong? I can get more information if you need it.

Thanks,

John

AlJohri commented 10 years ago

Just curious: what's your use case for using JSONP?

Can you post a jsfiddle with your issue?

LindsayYoung commented 10 years ago

Hello @johnalexhall85, Here is a CapitolWords JSONP example you might find helpful http://jsfiddle.net/rover/2YW5B/