1

For some debugging and statistics need to recursive convert to JSON JavaScript-object "window.navigator" and send it to server. But have problem with it. For example i use JSON-plugin for jquery:

jQuery.toJSON(window.navigator)

and Firefox say to me:

"{"mozPay":null,"mozContacts":{},"mozApps":{},"mozTCPSocket":null}"

but window.navigator have many other properties: language (str), languages (arr), plugins (arr with objects).

Google Chrome says:

RangeError: Maximum call stack size exceeded

How can i get all window.navigator content in JSON in both browsers?

  • That's a circular structure and you can't convert it to JSON. – Ram Feb 14 '15 at 18:03
  • Yes you can. See this response. http://stackoverflow.com/questions/9382167/serializing-object-that-contains-cyclic-object-value – bhspencer Feb 14 '15 at 18:03

0 Answers0