Last active
December 15, 2015 06:58
-
-
Save wteuber/5219671 to your computer and use it in GitHub Desktop.
Find contradicting click events on links and submits.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Run this code in your js console after the page has been loaded completely*/ | |
/* "!== undefined" at the end simply prevents unwanted output in the js console.*/ | |
$('a').each(function () { | |
var self = $(this); | |
if ((self.attr('href') && self.attr('href').indexOf('#') !== 0) && (self.data('events') !== undefined) && (self.data('events').click !== undefined)) { | |
console.log(this, self.attr('href'), self.data('events')) | |
} | |
}) !== undefined | |
$('[type="submit"]').each(function () { | |
var self = $(this); | |
if ((self.data('events') !== undefined) && (self.data('events').click !== undefined)) { | |
console.log(this, self.data('events')) | |
} | |
}) !== undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment