@public #get #parmeter #url #javascript #js #jquery

how to grab URL GET parameters with Javascript

<div class="content">
  <p>Lorem Ipsum Anything</p>
  <script type="text/javascript">
    if(window.location.href.match(/arg=testA/)){
      document.write('<button name="button">Click me</button>');
    }elseif(window.location.href.match(/arg=TestB/)){
      document.write('<button name="button">Click me now!</button>');
    }else{
      document.write('<button name="button">Show me</button>');
    }
    /* Wobei in der match() Anweisung 
    ** ein beliebiges RegEx enthalten 
    ** sein kann.
    */
  </script>
  <p>Lorem Ipsum Anything</p>
</div>