JQuery reading URL won't read letter A
<p>I am using the following to extract variables from the URL</p>

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

<p>This works great with numbers, but, when I try it on a string it stops at the letter A</p>

<p>Ajax call below</p>

<pre><code>$.ajax({
        url: apiURL,
        dataType: 'json',
        data: {page: page, user_name:$.urlParam('user')},
        success: onLoadData
    });
</code></pre>

<p>Example URL:</p>

<pre><code>http://mypage.com/pages/gf_profile?user=DaveSmith&amp;items=show
</code></pre>

<p>Firebug Inspector Shows (look at user_name variable)</p>

<pre><code>GET http://mypage.com/wishAPIs/profileWLAllAPI.php?page=1&amp;user_name=D 200 OK 253ms
</code></pre>

<p>Another Example URL:</p>

<pre><code>http://mypage.com/pages/gf_profile?user=HelenMajor&amp;items=show
</code></pre>

<p>Firebug Inspector Shows</p>

<pre><code>GET http://mypage.com/wishAPIs/profileWLAllAPI.php?page=1&amp;user_name=HelenM 200 OK 253ms
</code></pre>

<p>Example URL that is ok:</p>

<pre><code>http://mypage.com/pages/gf_profile?user=MickBrown&amp;items=show
</code></pre>

<p>Firebug Inspector Shows</p>

<pre><code>GET http://mypage.com/wishAPIs/profileWLAllAPI.php?page=1&amp;user_name=MickBrown 200 OK 202ms
</code></pre>

<p>This is very bizarre, any ideas?</p>
