есть кнопка
<a href="" onmousedown="return LinkClicked(this)" class="btn" id="btn_1">test</a>
js
var ScriptLocation = "/log.php";
/* No other customizations required. */
function LinkClicked(obj) {
var http;
if (window.XMLHttpRequest) {
try { http = new XMLHttpRequest(); }
catch(e) {}
}
else if (window.ActiveXObject) {
try { http = new ActiveXObject("Msxml2.XMLHTTP"); }
catch(e) {
try { http = new ActiveXObject("Microsoft.XMLHTTP"); }
catch(e) {}
}
}
if(!http) { return false; }
ScriptLocation += "?link=" + escape(obj.href) + "&page=" + escape(document.URL);
http.onreadystatechange = function(){};
http.open('GET',ScriptLocation,true);
http.send('');
return true;
}