PDA

View Full Version : JSON error too much recursion



slckysr
18 Jan 2011, 7:51 AM
i get this error: too much recursion at my ajax request to a php file



tmpadv = 'blablablablablabla';
tmpgroup = 'blablablablablabla';
tmpc = 'blablablablablabla';

tmpdata = tmpadv + ';' + tmpgroup + ';' + tmpc;

Ext.Ajax.request({
url: 'inc/process.php',
params: {
op: 'wizard',
data: Ext.util.JSON.encode(tmpdata),

s1: Ext.util.JSON.encode(store1),
s2: Ext.util.JSON.encode(store2),
s3: Ext.util.JSON.encode(store3)
},
method: 'POST',
success: function(result, request){

},
failure: function(result, request){
},
});
each of the stores has only 3 or 4 records with 4columns : so itisnt soo much but why i cant send this little bit of data ?

the blablablabla is the same length of code which will be collect from a different variable. so dont hang on it ;)

Condor
18 Jan 2011, 7:53 AM
You can't encode a store. It contains circular references.

You need to collect the store data and encode that, e.g.

var data1 = [];
store1.each(function(r){
data1.push(r.data);
});

slckysr
18 Jan 2011, 8:03 AM
:) ok thank you Condor, im going to try it out.

and thanks for the other post too.

slckysr
18 Jan 2011, 8:18 AM
it worked, thank you Condor