I created this code to send user invites by websocket but It doesn't work and shows this error:
Uncaught TypeError: Converting circular structure to JSON
$.each(formAttibutes, function(index, formAttribute){
if (formAttribute[0].value !== 0) {
if (formAttribute[1].value !== 0) {
var friend = {
"name": formAttribute[0],
"description": formAttribute[1],
};
socket.send(JSON.stringify(friend));
}
}
});
Oh gosh I'm sleepy, sorry. As you said infinity reference (replace formAttribute[1] >> formAttribute[1].value) thanks!