window.location.href send multiple parameters JSP
<pre><code>var jspcall = "commonchart?userRole=" + btoa(userRole) + "&amp;temName=" +btoa("TempOne");
     window.location.href = jspcall;
</code></pre>

<p>I want to pass userRole data and temName data using url. Therefor I create above java script code. But when I getting data I cannot get true userRole data. How can I filter return value in userRole data. temName data is ok. </p>

<pre><code>var userRole = location.search.split('userRole=')[1];
    //var userrole = atob(userRole);
    alert(userRole);
    var temName = location.search.split('temName=')[1];
    var temname = atob(temName);
    alert(temname);
</code></pre>

<p>userRole return value like that <code>YnVmZmVyLXN0b2Nr&amp;temName=VGVtcE9uZQ==</code> How can I split correct data for finding userRole data.</p>