I have a problem with converting a JSON in string. On iOS all works perfect but on Android I have this error:
[ERROR] : TiExceptionHandler: (main) [2,20592] - Message: Uncaught TypeError: Converting circular structure to JSON
This is my code:
var args = $.args
var data = args.data;
var oferta = data.oferta;
var params = data.params;
var parent = args.parent;
//INSERT
var producto = Alloy.createModel('Producto', {
oferta_id: parseInt(oferta.id),
data: JSON.stringify(args) //ERROR
});
The args passed to the controller are like this:
var args = {
data:
{
oferta: {id: 5},
params:{id_opcion_precio: 3445}
},
parent: {}
}
What's wrong?? Why on iOS works fine???