Change URL on first and second clicks
<p>I've searched the internet and stackoverflow for how to trigger a second click function and this is what I found:</p>

<pre><code>$('.elementclass').toggle(
function(){
   //on odd
    },
function(){
   //on even
}); 
</code></pre>

<p>It's perfect. Now according to this I try to change the URL of my document but something doesn't work. Here is my code:</p>

<pre><code>$('.orderby').toggle(
function(){
      document.location.href+='?orderby='+$(this).val()+'ASC';
},
function(){
      document.location.href+='?orderby='+$(this).val()+'DESC';
});
</code></pre>

<p>where <code>$(this).val()</code> will be something like name or date...</p>

<p>What I want to accomplish is: on first click of a button, the URL changes to <a href="http://blablabla/page.php?orderby=nameASC" rel="nofollow">http://blablabla/page.php?orderby=nameASC</a> and then on the second click, the URL changes to <a href="http://blablabla/page.php?orderby=nameDESC" rel="nofollow">http://blablabla/page.php?orderby=nameDESC</a>.</p>

<p>So what's wrong with my code?</p>

<p><strong>I don't want to refresh the page when user click on button, I just want to add some (one in this case) parameters that can take whit $_GET later but on same page.document.URL can be update whit +=?orderby=nameASC on first click and on second click +=?orderby=nameASC need to be remove and document.URL update whit +=?orderby=nameDESC.</strong></p>
