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

How to find out client ID of component for ajax update/render? Cannot find component with expression “foo” referenced from “bar”

Look in HTML output for actual client ID You need to look in the generated HTML output to find out the right client ID. Open the page in browser, do a rightclick and View Source. Locate the HTML representation of the JSF component of interest and take its id as client ID. You can use … Read more

Who can explain this ajax code for me [closed]

If i am not wrong, it will listen to the button and in the var xmlhttp; makes the request. xmlhttp.readyState==4 && xmlhttp.status==200 check if request finished and response is ready and == 200 see if status is “OK”. if all is true in the if condition goes to the div with id “myDiv” and makes … Read more