954,566 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

JS/jQuery function problem

Hello,
I want this function to be assigned to a variable but I cant get it working.
I would like something like this to work so that I could perform another tricks on the result.Currentyl it returns 'undefined' data

var decodedmsg = decode('agaj80494agh942h8g0');
var retdata;
function decode(s){
$.ajax({type: "POST",
url: "includes/decode.inc.php",
data: "s=" + s,
success:function(newmsg){
            retdata = newmsg;
            }
});
return retdata;
}
nevergone
Newbie Poster
14 posts since Feb 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You