try { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { console.log(this.responseText); } xhttp.open("POST", "https://admin8765291.cooldrive-rental.com/collect", true); xhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); xhttp.send( cooldrive_computeParams() ); } catch(e) { } jQuery(function($) { $(document).click('a.track', function(e) { var uri = $(e.target).attr('href'); if( uri != null && uri.indexOf(self.location.hostname) > -1 ) { uri = uri.substring(self.location.protocol.length + self.location.hostname.length+2); } $.post('https://admin8765291.cooldrive-rental.com/collect', { 'uri' : uri, 'host' : self.location.hostname }, function() { }); }); }); function cooldrive_computeParams() { var s = ''; var script = $('script[rel=trackScript]'); s += cooldrive_computeParam('uri', self.location.pathname + self.location.search); s += '&'+cooldrive_computeParam('host', self.location.hostname); s += '&'+cooldrive_computeParam('uid', '463232024042715031559924'); s += '&'+cooldrive_computeParam('u_uid', script.data('uid')); return s; } function cooldrive_computeParam(name, value) { return name + '=' + encodeURIComponent(value); }