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 | jwestbr...@gmail.com



On Tue, Aug 7, 2012 at 11:29 AM, Walter Lee Davis <wa...@wdstudio.com>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
> prototype-scriptaculous@googlegroups.com.
> To unsubscribe from this group, send email to
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> 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 prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to