I must be making a silly mistake but I cannot return the data I get from a $.post function and store it in a variable, not only that, I cannot return ANYTHING from within th
$.post is a asynchronous function. The control from function will immediately return after it run post but the response from post may be received later.
So what you can do is instead of return, use a call back function and define callback function outside.
say,
function test(){
$.post("demo_test_post.asp",
{
name:"Donald Duck",
city:"Duckburg"
},
function(data,status){
my_function(data)
});
}
function my_function(data){
// you can operate on data here
}