uniqueId.js 283 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 define(function () { // Generate a unique integer id (unique within the entire client session). // Useful for temporary DOM ids. var idCounter = 0; function uniqueId(prefix) { var id = ++idCounter + ''; return prefix ? prefix + id : id; } return uniqueId; });