title: How replace query string values using jQuery?
body: <p>I have a problem , my original URL looks like this:</p>
  
  <pre><code>test.com/?manufacturer=0&amp;body-style=0&amp;min-price=270%2C000&amp;max-price=780%2C000
  </code></pre>
  
  <p>As you can see, the min-price and max-price values in the query string is not correct due to the comma that is passed to the URL. It should be in their respective integer value like min-price=270000 and max-price=780000.</p>
  
  <p>I need to convert the query string values of min-max and max-price using jQuery. I currently do not how to do this actually. But I have codes to get them from the URL and then convert them to the correct value. I just don't know how to implement them back to the URL (as new URL) using jQuery. These are my existing codes:</p>
  
  <pre><code>    //Function to get value of parameter in query string
      function getParameterByName(name) {
          name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
          var regex = new RegExp("[\\?&amp;]" + name + "=([^&amp;#]*)"),
             results = regex.exec(location.search);
          return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
  }
  
      //Function to remove commas and convert to number
      function convert_to_pure_number(x) {
  
      //Remove commas
      var x_withoutcommas=x.replace(/,/g,'');
  
      //Convert to plain number
      var y =parseInt( x_withoutcommas ,10);
  
              return y;
      }
  
      var min_price_original=getParameterByName('min-price');        
      var max_price_original=getParameterByName('max-price');        
      var min_price_converted=convert_to_pure_number(min_price_original);       
      var max_price_converted=convert_to_pure_number(max_price_original);
  </code></pre>
  
  <p>Any suggestions how will I continue the above code with the additional code to put them back to the URL posted? Thanks for any help.</p>
  
  <p><strong>UPDATE</strong>
  This is the process:
  Form will be posted to the server--> URL will contain commas --> My new code will remove the comma --> In the query string value, correct value will be used.</p>
  
  <p>Cheers.</p>