How can I do the following thing:
When a user clicks on an external link e.g http://google.pl, jQuery detects the click and do some action.
I can do this using PHP, but then the link will be not external.
Could someone help me please?
How can I do the following thing:
When a user clicks on an external link e.g http://google.pl, jQuery detects the click and do some action.
I can do this using PHP, but then the link will be not external.
Could someone help me please?
if you want to process every link click:
$('a').click(function(e){
... do something ...
});
or you may filter links using something like:
$('a[href^="http://google.com/"]')