Hello, I wite this code:
var svy_data = {from_servoy:'OK', id_product: 1, id_idioma: 1}
Then I “debug” my code using application.output(plugins.serialize.toJSON(svy_data)) and I receive:
"{\"_id_product\":1,\"javaClass\":\"org.mozilla.javascript.NativeObject\",\"_id_idioma\":1,\"_from_servoy\":\"OK\"}"
Why the serialize plugin put an underscore at the beginning of the properties? In the serialized string I see "_id_product" instead of "id_product"
log-out:
Hello, I wite this code:
var svy_data = {from_servoy:'OK', id_product: 1, id_idioma: 1}
Then I “debug” my code using application.output(plugins.serialize.toJSON(svy_data)) and I receive:
"{\"_id_product\":1,\"javaClass\":\"org.mozilla.javascript.NativeObject\",\"_id_idioma\":1,\"_from_servoy\":\"OK\"}"
Why the serialize plugin put an underscore at the beginning of the properties? In the serialized string I see "_id_product" instead of "id_product"
This is added for some internal logic in the code.
Ops… I would like to send data to a PHP script using json. PHP has a json decoder, but it doesn’t use that underscores, so it unserializes the object in the example adding the underscore to the properties. It’s annoying
![Neutral :|]()
log-out:
Ops… I would like to send data to a PHP script using json. PHP has a json decoder, but it doesn’t use that underscores, so it unserializes the object in the example adding the underscore to the properties. It’s annoying
![Neutral :|]()
You can just fix the string in javascript (maybe something like replace: "_ with "). Or open a case in our support system and we’ll see what can be done about it (http://www.servoy.com/s).