title: Pass javascript var to ajax load
body: <p>Soo I do an ajax load to load a php file in my website. however I need to pass the variable "needednumber" to this php file. How would I do this? And how would I open it in the php file?</p>
  
  <pre><code>&lt;script&gt;
      var arr = &lt;?php echo json_encode($arr) ?&gt;;
  
      function deletefunction(pass) 
      {
  
      var needednumber = arr[pass];
  
      //$description = $_POST['needednumber'];
      $('#ajax').load('&lt;?php echo get_template_directory_uri(); ?&gt;/deletefavorite.php?choices=&lt;?php echo $description; ?&gt;');
  
      }
  </code></pre>
  
  <p></p>