Reputation: 7516
Below is my data object structure as printed out on the console of Safari:
_Api (2)
0 {company_code: 64, clerk_code: "RO", clerk_name: "Akshay", list_a: 1, list_b: 0}
1 {company_code: 64, clerk_code: "SA", clerk_name: "Lokur", list_a: 0, list_b: 1}
Now when I use JSON.stringify(data)
in order to send this to server side code from Jquery $.ajax
method, I am getting following error:
TypeError: JSON.stringify cannot serialize cyclic structures.
Confused how my data is cyclic..!
Any clues anyone?
Upvotes: 0
Views: 721
Reputation: 7516
Works like this:
var data = acct_clerk_datatable.rows('.selected').data().toArray();
var json = JSON.stingify( data );
Upvotes: 1