I'm using JSON.stringify(myString)
in Mozilla Firefox to convert a JavaScript object to a JSON string.
This function is working very well, but myString
is very large, and I have got an exception in Developer's Console:
The string you are trying to view is too long to be displayed by the Web Console.
And I can't fully copy json string.
I was trying to output this string in alert, but it has limit too. If there is any work-around how to solve it ?
Firefox und Chrome provide some helpers available in the console.
One of these helpers is copy()
Firefox:
copy(object)
New in Firefox 38. Copy the argument to the clipboard. If the argument is a string, it's copied as-is. If the argument is a DOM node, its outerHTML is copied. Otherwise, JSON.stringify will be called on the argument, and the result will be copied to the clipboard.
Chrome:
copy(object)
copies a string representation of the specified object to the clipboard.
For Firefox it would be:
copy(yourObject)
You could log it to localStorage:
localStorage.setItem('JSON String', JSON.stringify(yourObject));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With