Internet explorer doesn't like object definitions without quotes around the
names
if(typeof Element.store == 'undefined'){
Element.addMethods({
"store": function(elm, k, v){
elm[k] = v;
},
"retrieve": function(elm, k){
return (elm[k]);
}
});
}
Jason Westbrook | T: 313-799-3770 | [email protected]
On Tue, Aug 7, 2012 at 11:29 AM, Walter Lee Davis <[email protected]>wrote:
> 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.
>
>
--
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.