Ajax, sending JSON/data with boolean value
Hi,
I'm not sure what kind of issue that is. I wonder if this is a bug or more a feature request?
I have the following code:
- $.post(url, { thesaurus: false }, ...);
So a POST-request is started, which is converted by jQuery into this (Firebug output):
- thesaurus=false
which is on server-side (PHP f.e.) a
- string(5) "false"
(string!) meaning (bool)TRUE.
Wouldn't it be better to convert values like this automatically to a format which works (integer).
My workaround is
- thesaurus: (false?1:0))
(false is a variable, replaced here with the boolean value for a better understanding)