I have a handrolled AJAX js file I use, the problem is if I then use the makeRequest() function from within a function and have code below this call, the code continues to run before a response it returned from the AJAX call.
I have gotten round this by having the makeRequest() function call another function with return vars, which i then query to work out which function called the AJAX and continue processing.
Although this works, it's a bit ugly, so how do I make the code below the makeRequest() call wait till the response is returned or I guess another way would be is it possible to call a routine that is held in a variable.
eg. I call makeRequest(url,vars,functionname), passing the name of the function I want to be called, then in the AJAX funtion when finished i want it to call the function in the variable functionname. is this possible?
thanks 1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
I have gotten round this by having the makeRequest() function call another function with return vars, which i then query to work out which function called the AJAX and continue processing.
Although this works, it's a bit ugly, so how do I make the code below the makeRequest() call wait till the response is returned or I guess another way would be is it possible to call a routine that is held in a variable.
eg. I call makeRequest(url,vars,functionname), passing the name of the function I want to be called, then in the AJAX funtion when finished i want it to call the function in the variable functionname. is this possible?
thanks 1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.