I use fullcalendar jquery plugin from http://arshaw.com/fullcalendar/ and I use knockout js on my website.
I added the event array what is the source of the calendar. The user can modify the events (array).
Then I want to serialize the event array, send by ajax, but I can not, because the calendar modifies my array, and puts an cycle into the source array. How can I remove the changes. Why is there a cycle in my array? I read, may be there is an DOM object in this.
Chrome sendrequest error: TypeError: Converting circular structure to JSON
var a = [];
a.push({
title: "Event2",
start: "2013-09-05"
});
a.push({
title: "Event2",
start: "2013-09-15"
});
$("#calendar").fullCalendar({
events: a,
header: {
left: "title",
center: "",
right: "today prev,next"
},
editable: false
});
console.log(JSON.stringify(a));
TypeError: Converting circular structure to JSON
How can I fix it? What is the cause of the cycle?
fiddle example, you can see my problem: