JSON.stringify() differences between Android and iPhone
The following:
var data = {
'user' : {
'email' : emailField.value,
'password' : passwordField.value
}
};
parsed = JSON2.stringify(data);
Yields different results between Android(1.6 and 2.1) and iPhone(3.1) simulators (Titanium mobile 1.0):
- iPhone:
parsed is: {"user":{"email":"asdf","password":"adsf"}}
- Android:
parsed is: {"user":"{"email":"asdf","password":"asdf"}"}
I found that if I included the json2.js reference code from json.org, the results are inline with the iPhone results.
Anyone have any idea why the two platforms would be so different?