Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum call stack size exceeded during JSON.stringify(navigator)

I am getting RangeError during serialization of Navigator object.

What could be the reason?

JSON.stringify(navigator);
RangeError: Maximum call stack size exceeded

Browser: Chrome enter image description here

like image 888
P K Avatar asked Jan 12 '13 05:01

P K


1 Answers

That's because, as the error message says, the navigator object is too big.

You can use dystroy's modified JSON function like this:

var navJSON = JSON.pruned(navigator);

The object returned is pretty huge, but it's almost certain that it isn't completely correct. If you want to transfer data about the navigator object using JSON, you should send those properties only, not the entire object.

like image 131
Some Guy Avatar answered Sep 24 '22 08:09

Some Guy