title: How to change the url
body: <p>I want to change the URL of the update operation. The end point of the URL should be gotten from an input. How can I achieve this? The following doesn't work.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    $(document).ready(function(){
        
         $.fn.serializeObject = function()
  {
      var o = {};
      var a = this.serializeArray();
      $.each(a, function() {
          if (o[this.name] !== undefined) {
              if (!o[this.name].push) {
                  o[this.name] = [o[this.name]];
              }
              o[this.name].push(this.value || '');
          } else {
              o[this.name] = this.value || '';
          }
      });
      return {"issue":o};
  };</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form role="form"&gt;
      &lt;div class="form-group input-group"&gt;
          &lt;div class="row"&gt;
          &lt;div class="col-md-6"&gt;
          &lt;label&gt;Issue ID * &amp;nbsp;&lt;/label&gt;
          &lt;select class="form-control selectclass" id="issueid"&gt;&lt;/select&gt;
          &lt;/div&gt;
          &lt;div class="col-md-6"&gt;
          &lt;label&gt;Tracker * &amp;nbsp;&lt;/label&gt;
          &lt;select class="form-control" name="tracker" id="tracker"&gt;
            &lt;option value="1"&gt;Bug&lt;/option&gt;
            &lt;option value="2"&gt;Feature&lt;/option&gt;
            &lt;option value="3"&gt;Support&lt;/option&gt;
          &lt;/select&gt;
          &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;label&gt;Subject &amp;nbsp;&lt;/label&gt;
          &lt;input class="form-control" placeholder="Issue Subject" name="subject" id="subject"&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;label&gt;Description&lt;/label&gt;
          &lt;textarea class="form-control" rows="6" name="description" id="description"&gt;&lt;/textarea&gt;
      &lt;/div&gt;
    &lt;button type="submit" id="submit" class="btn btn-default"&gt;Submit Button&lt;/button&gt;
    &lt;button type="reset" class="btn btn-default"&gt;Reset Button&lt;/button&gt;
    &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('#submit').on('click', function(){
              var x=document.getElementById('issueid').value;
              $.ajax({
                  type : 'PUT',
                  
                  url: 'http://localhost/redmine/issues'+ x +'.json',
                 
                  
                  contentType:'application/json',
                   
                  data:JSON.stringify($('form').serializeObject()), // post data || get data
                  success : function(msg, status, jqXHR) {
                      console.log(msg, status, jqXHR);
                      
                  },
                  error: function(xhr, resp, text) {
                      console.log(xhr, resp, text);
                  }
              })
              console.log(x);
           });
     
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>Inputs are gotten from a form and sent to Redmine API. URL should look like below, <code>http://localhost/redmine/issues/2.json</code></p>