Created
January 15, 2012 21:09
-
-
Save waxzce/1617346 to your computer and use it in GitHub Desktop.
find dups id in your html
This file contains hidden or 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
var find_dbl_ids = function(){ | |
var names = {}; | |
$('*[id]').each(function(i, e){ | |
var iid = $(e).attr('id'); | |
if(iid != null && iid != ''){ | |
if(names[iid] == undefined){ | |
names[iid] = 1; | |
}else{ | |
names[iid] = names[iid]+1; | |
} | |
} | |
}.bind(this)); | |
var logs = require('logger4js').named('finddblid'); | |
for(var y in names){ | |
var name_nb = names[y]; | |
if(name_nb > 1){ | |
logs.info(y + ' : '+name_nb); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment