也许我错过了它,但是我看不到Spine.js在哪里为新创建的记录生成唯一的it。
这方面的一个例子是在脊椎联系人示例(http://spine-contacts.herokuapp.com)中单击“新联系人”,然后在url中看到id。
如果你能解释如何包含来自源代码的行号,那就太好了。谢谢!
发布于 2012-02-25 04:44:16
基于他们来自github spine.js的代码,下面的函数生成guid:
guid = function() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r, v;
r = Math.random() * 16 | 0;
v = c === 'x' ? r : r & 3 | 8;
return v.toString(16);
}).toUpperCase();
};https://stackoverflow.com/questions/9437173
复制相似问题