Revision 641d6d24
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
js/kivi.js | ||
---|---|---|
415 | 415 |
console.error('kivi.run("' + function_name + '"): No function by that name found'); |
416 | 416 |
return undefined; |
417 | 417 |
}; |
418 |
|
|
419 |
ns.detect_duplicate_ids_in_dom = function() { |
|
420 |
var ids = {}, |
|
421 |
found = false; |
|
422 |
|
|
423 |
$('[id]').each(function() { |
|
424 |
if (this.id && ids[this.id]) { |
|
425 |
found = true; |
|
426 |
console.warn('Duplicate ID #' + this.id); |
|
427 |
} |
|
428 |
ids[this.id] = 1; |
|
429 |
}); |
|
430 |
|
|
431 |
if (!found) |
|
432 |
console.log('No duplicate IDs found :)'); |
|
433 |
}; |
|
418 | 434 |
}); |
419 | 435 |
|
420 | 436 |
kivi = namespace('kivi'); |
Auch abrufbar als: Unified diff
kivi.detect_duplicate_ids_in_dom: Funktion zum Auffinden doppelter IDs im DOM