title: How to resolve having apostrophe in the URL inside a parameter
body: <p>In my view im passing a modelAttribute value in the URL as a parameter in an event on a mouseClick. </p>
  
  <p><strong>code snippet :</strong></p>
  
  <pre><code>&lt;li&gt;&lt;a data-toggle="tab" onclick="loadOrders()"&gt;Orders&lt;/a&gt;&lt;/li&gt;
  
  &lt;script type="text/javascript"&gt;
       function loadOrders() {
          window.location = '/admin/business/${businessId}/order?'+encodeURIComponent('appType=${appType}&amp;appName=${appName}').replace(/'/g, "''");
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>so when the parameter appName have an apostrophe or any other tricky character i'm having <code>Uncaught ReferenceError: loadOrders is not defined at HTMLAnchorElement.onclick</code> error on the browser console. Eventhough here i'm trying to replace the character i'm still getting the error. How to resolve this and pass the parameter in the URL with encoding correctly?</p>