Jeff Watkins wrote:
> ...
> Element.Methods.assignId = function(element) {
> element= $(element);
> if (!element.id)
> element.id= "uniqeId_" + (arguments.callee._nextUniqueId++);
> return element.id;
> }
> Element.Methods.assignId._nextUniqueId=0;
> ...
+1 for such an addition.  It is especially useful for object 
hashing--being able to look up some data by element.  It looks like the 
YUI library uses a similar function called generateId() in their drag 
and drop, menus, treeviews and more.

- Ken Snyder

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to