| Page 1 of 1 | [ 3 posts ] |
|
Hi,
I found out the set/getData methods are only valid in one sandbox, once you create another one, you cannot get data you set to the previous sandbox. So set/getData is not working across different sandboxes. See the example I created at jsfiddle:http://jsfiddle.net/pV8WA/2/ What I really want is, if I apply my plugin to a node, when the second time I try to apply it, I should be able to detect whether this node already has the plugin or not. Therefore, my orignal idea was to setData to this node when first apply the plugin, then, when second time if I can getData from this node, I will know this node has already got the plugin that I don't need to apply to it anymore. Currently, I can use set/getAttribute to a DOM element and make it works. But I prefer to hide this information and use set/getData to a node object. According to the example I created above, set/getData doesn't work across sandboxes, I sort of understand why. But is it a bug or how can I get around with this problem? Thanks |
|
It's not a bug, it's by design. Sandboxes should not share data between them. So one sandbox reading the data from a Node belonging to another sandbox violates that sandbox.
|
|
Thanks
|
| 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