Function to Get Params Cuts Off Values
<p>I'm using this function to get my params in Javscript, but on occassion, it cuts off my <code>charge_id</code> param.</p>

<pre><code> $.urlParam = function(name) {
    var results = new RegExp('[\\?&amp;amp;]' + name + '=([^&amp;amp;#]*)').exec(window.location.href);
        if (results) {  return results[1] || 0;  }
 };  

 if ($.urlParam('success')) {
    // Get Charge ID from param
    var chargeId = $.urlParam('charge_id') 
 };
</code></pre>

<p>In this case, the <code>charge_id</code> parameter was shortened by the above expression:</p>

<pre><code>lvh.me:3001/?charge_id=ch_1hK2X4XiaCv3r8&amp;success=true
</code></pre>

<p>This is what is returned:</p>

<pre><code>ch_1hK2X4Xi 
</code></pre>
