3

I'm looking at the WordPress Google Analytics plugin, specifically the external link javascript file and I'm having trouble figuring out what this syntax means:

$('a:external').on( 'click.wp-google-analytics', function(e){

I see previously we defined a custom filter for external links but I'm talking about the click.wp-google-analytics. I didn't know a click could have a class name. Can anyone point me in the right direction of understanding this and why the class name is required?

0

1 Answer 1

9

It's a namespaced event. Provides a way to ensure you don't clobber existing events that might be attached by other users/plugins

http://docs.jquery.com/Namespaced_Events

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.