Hello to all,
This is my code and the call does complete and the back end perl script updates the database but I continue to get a onFailure - not sure how to troubleshoot this. I have changed method to post and it works for a bit then begins to fail again. At present it is failing with 500 every time but the actual code being called is working perfectly.
Thanks any and everyone who can give me a bit of guidance
function get_update_odometer(vehicle_key,odometer_value){
var url = "[%Catalyst.uri_for('/invoice/dispatch_util/get_update_odometer')%]";
new Ajax.Request(url, {
method: 'get',
parameters: {
key: vehicle_key,
ovalue: odometer_value
},
asynchronous:false,
onSuccess: successFunc,
onFailure: failureFunc
});
var return_v = $('rcontainer').innerHTML;
document.getElementById('odometer').value = return_v;
return true;
}
function successFunc(response){
if (200 == response.status){
var container = $('rcontainer');
var content = response.responseText;
container.update(content);
}
}
function failureFunc(response){
alert("Call has failed " + response.status );
}
I'm not familiar with Catalyst, but is it setting a 200 header or similar with your return? You may want to emit a couple of spaces or similar, just to force the issue.
Walter