I have a function that might need to run under 1.6 or 1.7, but I don't want to
branch my code horribly around store and retrieve. This seems to work:
if(typeof Element.store == 'undefined'){
Element.addMethods({
store: function(elm, k, v){
elm[k] = v;
},
retrieve: function(elm, k){
return (elm[k]);
}
});
}
Can anyone spot any reason why it might fail horribly in some browser?
Walter
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.