Avatar of lvmllc
lvmllc
Flag 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

jQueryAJAX

Avatar of undefined
Last Comment
leakim971

8/22/2022 - Mon
Gary

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

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy