[Plugin: WP Slimstat] firing on links that have jQuery .click() actions
-
Here is what happens:
Slimstat checks at install time for onClick before attaching to the click event of
<a>
elements. This means that any click event handlers added by other code after slimstat installs get missed. When the user clicks the link the new event handler runs and calls.preventDefault()
which should stop the link from being followed but insteadslimstat_track_link()
simulates the click anyway leading to unpredictable results. This is particularly a problem with jQuery because it tends to bind.click()
late due to the use of.ready()
The fix is probably to check for the presence of other click handlers in
slimstat_track_link()
and bail if you find more than one total.Click the ‘RepostUs’ button on this page to see this happening https://juliasherred.com/2011/05/dan-freeman-interview/
- The topic ‘[Plugin: WP Slimstat] firing on links that have jQuery .click() actions’ is closed to new replies.