jQuery ajax request: how to access sent data in success function?
<p>So I'm trying to achieve the following, but I can't figure out how to make this work.</p>

<pre><code>$.ajax({
  url: "whatever.php",
  method: "POST",
  data: { myVar: "hello" },
  success: function(response) {
    console.log('received this response: '+response);
    console.log('the value of myVar was: '+data.myVar); // &lt;&lt;&lt;&lt; data.myVar is not accessible from here
    console.log('the value of myVar was: '+myVar); // &lt;&lt;&lt;&lt; myVar is not accessible from here
  }
});
</code></pre>

<p>Is there a way to access the value of <code>myVar</code> in the <code>.success()</code> function?
Can I somehow get to the original <code>data</code> object that was sent in this ajax request, in the <code>.success()</code> function?</p>

<p>Hoping for your solutions.
Thanks!</p>