I am trying to make a ajax call with Jquery to retrieve json data from a website. I can not get it to work in Jquery but I was able to make it work using the python Requests Library. How can I get the ajax data using jquery?
This code works and gets me the data I want (However, I want it client side not server side)
import requests
request = requests.get('http://volaris.com/locations/json/autocomplete/?term=tij&where=&loc=&lang=en')
This code does not. This is the code I would like to work. As of now, it only hits the fail function.
$.ajax({
url: 'http://volaris.com/locations/json/autocomplete/?term=tij&where=&loc=&lang=en',
type: 'GET',
daType: 'json',
cache: true,
error: function() {
alert( "ajax error" );
},
success: function(json) {
alert( "ajax success");
}
});