How to return AJAX response Text? [duplicate]
remember that onComplete is called long after the someFunction is done working. What you need to do is pass a callback function to the somefunction as a parameter. This function will be called when the process is done working (ie, onComplete): somefunction: function(callback){ var result = “”; myAjax = new Ajax.Request(postUrl, { method: ‘post’, postBody: … Read more