title: Jquery Javascript Variable
body: <p>Hello i have searched the whole website for a soltution found something but didnt get it to work.</p>
  
  <p>-I have the main function on the head area of the page. (This will return Data from a PHP)</p>
  
  <p>-This Data i need as a variable but dont know how to handle.</p>
  
  <pre><code>function note(content,usern){
  note = Function("");
    $.ajax({
     type: "POST",
     url: "note.php",
     data: {'token': content, 'user': usern },   success: function(data){ var myneededvar = data;  },    });  }
  </code></pre>
  
  <p>Ok thats works and also data is given out
  Now im calling the function in the script like this </p>
  
  <pre><code> note(token,notename);
  </code></pre>
  
  <p>and i need the result myneededvar</p>
  
  <p>but cant get it to work.</p>