Questions tagged [stringify]

A function that converts a JavaScript value to a JavaScript Object Notation (JSON) string.

A common use of JSON is to exchange data to/from a web server. When sending data to a web server, the data has to be a "string". Convert a JavaScript object into a string with JSON.stringify().

JSON.stringify() documentation.

718 questions
-1
votes
1 answer

Where can I find documentation on the JSON.stringify.replace() method?

In an answer for how to declare 2D JavaScript arrays, Declare an empty two-dimensional array in Javascript? Kamil Kiełczewski utilized the method JSON.stringify.replace() to format the array output and passed an expression (regular expression?) that…
yamex5
  • 195
  • 1
  • 11
-1
votes
2 answers

Modifying the output provided by JSON.stringify in some particular way

I am not familiar with javascript code, but for some reasons I am tweaking some js file available at github. One of the lines of the source code is JSON.stringify(a[2]) And some examples of the outputs I am getting (for the previous code)…
-1
votes
1 answer

Parse result of XML -> XML2JS ->JSON.stringify using JQ

I have a file created by doing an XHR fetch of XML and parsing it through the node module xlm2js and then JSON.stringify. It has about 700 segments of two basic types. This is an edited version of the file with one segment of each type: { …
NetFool
  • 571
  • 1
  • 6
  • 11
-1
votes
1 answer

How to unescape json.stringify output inside a object array

I'm getting a bad response when i post a json.stringify via fetch, and the problem is from escaped quotes that json.stringify is producing. It works when I remove them manually, but I need this to be done automatically. var order = { …
-1
votes
2 answers

Format JSON string using js/jquery to readable format in textarea

I have a js variable that contains an object. I'm passing the data in that object to a html