title: Get url parameter with jquery
body: <p>I want to read out an url parameter using jquery and bind this one in a variable. I've seen a lot of ways to solve it but definitely no one worked for me.</p>
  
  <p><a href="http://relaunch.headonline.de/projekte/#filter=kataloge-database" rel="noreferrer">http://relaunch.headonline.de/projekte/#filter=kataloge-database</a></p>
  
  <p><strong>-> I'm using a '#' instead of a '&amp;' or '?'!</strong></p>
  
  <p>This is my current javascript:</p>
  
  <pre><code>function $_GET(param) {
      var vars = {};
      window.location.href.replace( location.hash, '' ).replace( 
          /[?&amp;]+([^=&amp;]+)=?([^&amp;]*)?/gi, // regexp
          function( m, key, value ) { // callback
              vars[key] = value !== undefined ? value : '';
          }
      );
  
      if ( param ) {
          return vars[param] ? vars[param] : null;    
      }
      return vars;
  }
  
  var filter = $_GET('filter');
  </code></pre>