I'm trying to do something simple, capture any click event and send the url to a php script.
With the alert(a); the ajax.php will be call every single time, if I remove it, once every 20 clicks will work, I wonder if it's because the alert(a) slow things down ?
$('a').click(function(){
var a = $(this).attr('href');
$.ajax({
type: "POST",
url: "/ajax.php",
data: { b1: a , b2: "456" },
});
alert(a);
});
/ajax.phpwill get called for every click, irrespective of thealert