i am using new to prototype and using its ajax functionality but not able to set the values to return type my code is
var captchaRequest = new Ajax.Request('http://www.example.com/captcha/validate.php', {
parameters: "captcha_code="+captcha_code,
onSuccess: function(result) {
if(result.responseText == 'true') {
return true;
} else {
return false;
}
alert('in ajax response');
}
});
alert('after ajax')
what i want to do is execute some functionality after ajax call is complete and but my second alert which is 'after ajax' is getting executed before 'in ajax response'. I want to use code result from ajax response. please help.
Thank you, pankaj