title: How to pass a variable into the middle of $.ajax url with JQuery
body: <p>I'm passing a variable from one function into another, then need that variable set into the URL for the next ajax call, I thought this would be easy but nope.</p>
  
  <p>Here's my code, I removed my dev key from the end of the call. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function Transmission(styleID){
      $.ajax({
       url: "https://api.edmunds.com/api/vehicle/v2/transmissions/" + styleID + "?fmt=json&amp;api_key=REMOVED",// setting styleID number in URL with passed variable
          //force to handle it as text
          dataType: "text",
          success: function(data) {
     var json = $.parseJSON(data);
     $('#car_transmission').find("option[text=" + json.transmissionType + "]").attr("selected", true);
   }});
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>It's failing, but if I hard code the styleID it works just fine, all of the searches I did were to add variables to the end of the URL. Any thoughts are appreciated!!</p>
  
  <p>Thank you !!!!!!
  d</p>