title: Sending multiple values to jquery ajax from a function
body: <p>I want to use the following function for all the ajax calls in my site:</p>
  
  <pre><code>function ajaxcall(my_url, my_div, my_data)
          {
          $(my_div).append('&lt;div style="text-align:center; position:absolute; top:0; left:0; width:100%;"&gt;&lt;img src="/images/loading.gif" /&gt;&lt;/div&gt;');
          $.ajax({ url: my_url,
          data: {data: my_data},
          type: 'get',
          success: function(output) 
              {
              $(my_div).html(output);
              }
          });
          }
  </code></pre>
  
  <p>It gets whatever URL I want and updates the DIV I want, so far so good. The problem is I also need to send 1 or more values and want to predict the names of those values.</p>
  
  <pre><code>&lt;select class="formtext" name="car_id" id="car_id" onChange="ajaxcall('/ajax/carsetup.php', '#car_setups', $(this).val() )"&gt;
  &lt;option value="1"&gt;1&lt;/option&gt;
  &lt;option value="2"&gt;2&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;div id="car_setups"&gt;select car&lt;/div&gt;
  </code></pre>
  
  <p>So what this does is send my select value to the function, it works, however I don't know how to call that value anything, right now its called data but I want to name it whatever I wish, in this case car_id, dynamically, even worse I might want to send more values in that function's third <em>slot</em>. How would I get around this?</p>
  
  <p>Right now <code>print_r($_GET);</code> gives me:</p>
  
  <pre><code>Array ( [data] =&gt; 2622 ) 
  </code></pre>