Hi All,
I am using Ajax with Prototype library.
Here is my function that calls the Ajax function.
function Testfn()
{
var DateExists = '';
new Ajax.Request('testurl',{
method: 'post',
parameters: {param1:"A", param2:"B", param3:"C"},
onSuccess: function(response){
//DateExists = response.responseText;
DateExists = 1;
}
});
// I want to access the value set in the onsuccess function here
alert(DateExists);
}
When i alert the DateExists value i am getting null value instead of the value that is set in the onsuccess function of my Ajax call which is 1. How is that possible?
Thanks for any help.