title: how to use key/value pairs in ajax call for jquery data option
body: <p>Ive been checking out how to add variables to a ajax request which I can use in my server side script. I checked this stackoverflow post <a href="https://stackoverflow.com/questions/14140879/multiple-php-queries-in-one-file-for-ajax-call">here</a> and checked the jquery api docs <a href="http://api.jquery.com/jquery.ajax/#jQuery-ajax-settings" rel="nofollow noreferrer">here</a> for a ajax request. I am getting error <code>variable</code> in my code is not defined.</p>
  
  <p>I have this line in my code</p>
  
  <pre><code>return $.ajax({
        type: 'GET',
        url: '/users/show', 
        data: {'currentusershow': variable},
      });
  </code></pre>
  
  <p>I was wanting it to do something like this with the results so I can keep all my different script in the one file.</p>
  
  <pre><code>if ($.get("currentusershow")) { 
  // do something here 
  }
  else if...
  </code></pre>
  
  <p>i am not sure how to add the <code>value</code> to my code?</p>
  
  <p>Also my url does not work going to the show.js.erb where my code is kept.</p>