[Greasemonkey] storing arrays with GM_setValue
chris feldmann
cfeldmann at gmail.com
Sat Jun 4 03:33:19 EDT 2005
>No?
Hm. Maybe....
join? uneval? eval? I tried valueOf(). Are you suggesting I need to learn
all those pesky functions?
Kidding. That was pretty much what I was looking for. Especially uneval.
That's really a function? Wow, neat.
Thanks, man.
On 6/4/05, Jeremy Dunck <jdunck at gmail.com> wrote:
>
> On 6/4/05, chris feldmann <cfeldmann at gmail.com> wrote:
> > No matter how I try to serialize an array through GM_setValue, I get an
> > error: (roughly) "Attempt to set a preference with variable type:
> Object."
>
> Can you make assumptions about the contents of your array?
>
> If so:
> ["test", "me"].join(",")
>
> If not, maybe:
> var a = ["test", "me"];
> GM_setValue("anarray", uneval(a));
> var b = eval(GM_getValue("anarray");
>
> No?
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/greasemonkey/attachments/20050604/c2a77dd4/attachment.htm
More information about the Greasemonkey
mailing list