I have been staring at this for 6 hours. I don't understand.
$.ajax({
url: "http://www.band.dev:8888/datafeeder/hello_world",
success: function( data ) {
alert (data);
},
error: function(request, status, error) {
alert(status + ' - ' + error);
}
});
I'm running MAMP locally, and when I hit the URL directly it echos 'hello world', no problem. When I run this, I get a dialog box with 'error - '. I've tried adding dataType:'html' in there, no help. Thoughts?
-- EDIT --
So this is my ACTUAL problem. When I run this, neither success nor error are fired, and I can see that the JSON is correct when I hit the URL directly. (BTW, the relative url fix worked for the above bit of code.)
$( "#member_type" ).autocomplete({
source: function( request, response ) {
$.ajax({
url: "/datafeeder/get_member_types/json",
dataType: "jsonp",
data: {
//maxNum: 12,
searchString: request.term
},
search: function(event, ui) {
alert('searching');
},
success: function( data ) {
alert (data);
response( $.map( data, function( item ) {
return {
label: item.type,
value: item.id
}
}));
},
error: function( request, status, error) {
alert (status + ' - ' + error);
}
});
}
});