Last active
December 17, 2015 01:28
-
-
Save uxDaniel/5528244 to your computer and use it in GitHub Desktop.
Logs in the console all the failed selectors passed to jQuery calls
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
//Override the $ function in order to log failed selectors | |
function $(arg) { | |
if ( jQuery(arg).length == 0) { | |
console.log(arg+" fails"); | |
} | |
return jQuery(arg); | |
} | |
//Reassign all the attributes | |
for (var attrname in jQuery) { $[attrname] = jQuery[attrname]; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment