Using split function in javascript want to split the url at the time of page load?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript">Get query string values in JavaScript</a>  </p>
</blockquote>



<p>I have a URL like below</p>

<pre><code>    http://domain_name/?act=SiteVisit
</code></pre>

<p>I want to split this URL and want to take act value in one variable at the time of page load.</p>

<pre><code>$('document').ready(function(){
    var mail_link  = window.location;   
    var arrURL     = mail_link.split('='); 
    alert(arrURL[1]);
    return false;
});
</code></pre>

<p>I used the above code but its not working.But if I print and assign the variable which i get in alert message its working</p>

<p>So tell me how to get the SiteVisit in a variable</p>
