[support] jQuery.ajax returns 404
Metzler, David
metzlerd at evergreen.edu
Fri May 21 22:57:09 UTC 2010
Did you look in your (watchdog)logs? Normally the 404's received by a
drupal sites are logged there with the full path.
Dave
-----Original Message-----
From: support-bounces at drupal.org [mailto:support-bounces at drupal.org] On
Behalf Of Scott
Sent: Friday, May 21, 2010 2:19 PM
To: Drupal Support
Subject: [support] jQuery.ajax returns 404
I'm still experimenting with a new citysearch module. I've managed to
fetch back the json with curl but I'd still like to let ajax handle it.
I have this function but it reports a 404 error. Is there a way to
determine the url value actually being sent? The generated value I'm
using here works both with window open() and with my curl function.
My code:
function processSearch(form) {
var what = js_trim(form.what.value);
var where = js_trim(form.where.value);
var loc = js_trim(form.location_or_event.value);
var publisher = js_trim(form.publisher.value);
var api_key = js_trim(form.api_key.value);
var URL = 'api2.citysearch.com/search/'+loc+'?what='+what
+'&where='+where+'&format=json&publisher='+publisher
+'&api_key='+api_key;
alert(URL);
$.ajax({
type: 'get',
url: URL,
dataType: 'jsonp',
success: function() { alert("Some success"); },
error:function (xhr, ajaxOptions, thrownError){
alert(xhr.status);
alert(xhr.statusText);
alert(xhr.responseText);
}
}); // end ajax method
}
function js_trim(str) {
return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); }
--
[ Drupal support list | http://lists.drupal.org/ ]
More information about the support
mailing list