| Page 1 of 1 | [ 3 posts ] |
|
Hi all,
I am working on a rather large ecommerce application, and we recently noticed that many of our HTML elements are being given YUI generated ID's. Something like: <div id="yui_3_4_5_67893243"></div> This appears to be happening indiscriminately, and since it is not a trivial process, we would love to find the source of the problem in our code, or in YUI's. Any thoughts on why/when YUI would do this ID generation? And how it could be running a bit rampant? Thanks! |
|
Y.Node does this in the constructor. It allows a huge optimization, because all the instances of Y.Node are stored in a map, so if you call Y.one() again later for the same node, it will return the same instance.
|
Juan Ignacio DopazoYUI Contributor
|
It's not only about optimization by caching. It is an important part of the Event system and the Widget infrastructure. For instance, there is a function called Widget.getByNode() that uses that id to match DOM nodes to widgets. That allows for event propagation in widgets and other cool stuff.
|
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group