943,028 Members | Top Members by Rank

Ad:
Aug 4th, 2010
0

JS/jQuery function problem

Expand Post »
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
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. var decodedmsg = decode('agaj80494agh942h8g0');
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. var retdata;
  2. function decode(s){
  3. $.ajax({type: "POST",
  4. url: "includes/decode.inc.php",
  5. data: "s=" + s,
  6. success:function(newmsg){
  7. retdata = newmsg;
  8. }
  9. });
  10. return retdata;
  11. }
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nevergone is offline Offline
13 posts
since Feb 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: learning ajax
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: javascript menu to hidden form instead of link





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC