afid übergeben

by Kevin Pliester

HTML

<a href="/kostenlos-teilnehmen/">Kostenlos teilnehmen</a>

JavaScript

(function($) {
  $.urlParam = function (name) {
    var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.search);    
    return (results !== null) ? results[1] || 0 : false;
  }
  
  if ( $.urlParam("afid") ) {
  
  	var afid = $.urlParam("afid");
  	
    console.log(afid)
  
  	$("a").each(function() {
    	var href = $(this).attr("href");
    });
  }  

})(jQuery);