Open GoogleCodeExporter opened 9 years ago
I have had no such fault at any time when using the library, and use Safari
quite regularly.
Can you tell me about the value you're trying to set to a cookie? Can you
provide any code?
Thanks,
Jim
Original comment by auldrid...@gmail.com
on 18 Feb 2013 at 5:30
The print out I have is:
value : [object HTMLInputElement]
jquery.cookies.2.2.0.js:232 cookies.set() JSON.stringify error, could
not serialize. erorr: TypeError: Type error
I traced the code but I still do not see yet where did I set an html
element. But in any case, that error caused the script to halt. So I
still have to keep the try catch around the code. Thanks for your
work.
Original comment by wpoosang...@gmail.com
on 18 Feb 2013 at 9:16
I will have to think about this some. You should definitely not be trying to
set a DOM element to a cookie, and you should attempt to resolve that (as you
alluded).
It seems to me that I could try to gracefully handle this sort of thing with a
built in try/catch, but honestly it is an error and it seems proper to cause a
JS error rather than silent failure. Otherwise a developer could think they
were setting things into cookies which they actually are not.
I think my best approach would be to leave my code as is, and warn devs in the
documentation that any value given to the library must be something which is
capable of serialization, else an error will be raised. If a dev thinks they
may end up in such a situation and cannot properly account for it in their
code, they should wrap their code in their own try/catch.
Original comment by auldrid...@gmail.com
on 18 Feb 2013 at 9:47
Just a suggestion, you should mark this as a WONTFIX. Right now it says it's
new.
Original comment by virtual...@gmail.com
on 9 Jul 2014 at 9:13
Original issue reported on code.google.com by
wpoosang...@gmail.com
on 18 Feb 2013 at 1:38