I'm trying to develop a drupal module to return json from the citysearch api. I can successfully construct the url and I can use the url to open a new window and display the returned json data, thus:
testwindow= window.open (URL, "mywindow",
"location=1,status=1,scrollbars=1,width=100,height=100");
however, my attempt to try this with ajax fails, thus:
$.ajax({
type: 'get',
url: URL,
dataType: 'jsonp',
error: function() { alert("Some error"); },
success: function() { alert("Some success"); }
}); // end ajax method
This always results in the "Some error" alert. I've tried it with 'get' and 'post' for type and with 'json' and 'jsonp' for dataType. No joy. I would appreciate any thoughts on what fundamental points I'm missing here.