jQuery click event fires twice

Today I had an issue with jQuery where a listener for a ‘click’ event was being triggered twice.
With the following code, I would get two logs in the console:

		return false;

I was even trying the jQuery(function() { }); method, but I would still get the same results.

After some debugging, I figured out that if I moved that javascript to be inside the <head></head> tag instead of the <body></body> tag which is where I originally had it, that would fix the problem.

Hope it helps,
Rafael Corral
Lead developer

The Core Team
Editorial Staff Members at 'corePHP'
Editorial staff for the Core Technology Blog for 'corePHP' - news, views insights and advice for e-commerce, marketing technology , web design and development.

2 thoughts on “jQuery click event fires twice

Comments are closed.