title: URIError: malformed URI sequence?
body: <p>The below code error's out with <code>URIError: malformed URI sequence?</code> when there is a <code>%</code> sign like <code>60% - Completed</code> in the URL string from where I need to extract the parameter value e.g. <code>http://some-external-server.com/info?progress=60%%20-%20Completed</code></p>
  
  <pre><code>   &lt;SCRIPT type="text/javascript"&gt;
              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, " "));
              }
      &lt;/SCRIPT&gt;
  </code></pre>
  
  <p>I dont have control of the server and need to process the output in my html page.</p>