Link to home
Start Free TrialLog in
Avatar of lvmllc
lvmllcFlag for United States of America

asked on

Load Jason $.ajax

I have two different URL's to JSON data - one works and the other does not.
My call to the openweathermap works fine, but the  citybikeNYC fails.
It looked to me like the structure was the same so not sure why this is happening.


//myURL = 'http://www.citibikenyc.com/stations/json';


myURL = 'http://api.openweathermap.org/data/2.5/find?lat=42.033449&lon=-93.630885&cnt=15&units=imperial';

//load data from external source
	$.ajax({
		url: myURL,
		dataType: 'json',
    	jsonp: false
	}).done(function(data) {
		console.log(data);
	console.log(data.count + ' data count');
		

	});

Open in new window

Avatar of Gary
Gary
Flag of Ireland image

Thats a cross origin policy error, they need to allow you to access the api or use jsonp
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial