function genID() {
var origin = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
origin = origin.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0;
var v = (c == 'x' ? r : (r & 0x3 | 0x8));
return v.toString(16);
});
return origin.toLowerCase();
}
///////////////////////////////////////////////////////////////////////////
$.generateID_ = _genID();function _genID() {
var pre, now, count = 1;
return function() {
var res = '';
now = (new Date()).getTime();
if (pre) {
if (pre === now) {
count++;
} else {
// 轉換點
count = 1;
}
} else {
// 最初狀況
}
pre = now;
/* ---------------------------------- */
res = now + '_' + count;
return res;
};
}