Im trying to return the value that a $ajax call returns, from a function but it only returns \"undefined\". If a alert the \"reponse\" from the ajax call it returns the rigth va
You cannot do this unless you wait for the ajax call to complete by using asynch:false. However I would not do this as it locks up the browser and if the call fails to return the user will have to crash out. It is better to refactor your script and within the success function of the .ajax call to invoke a callback function.
See my answer to a similar question here