Assign very large Json to a variable in String form

Asked

Viewed 103 times

0

I want to run some tests on an algorithm I’m developing with this Json.

To test this type of input, I always created a variable by assigning the json between crases, so the variable kept the string content in several lines and then used the Json.parse() to convert the string into a Json object, however, this specific Json, I cannot assign it in string form using the crase, I believe because it is too big. What can I do in this situation?

  • You can put the code you are using for that sff, to turn json into object

  • that’s basically it: var dados= \json content`; var fileJson = JSON.Parse(data); `

  • Everything looks fine: https://jsfiddle.net/c3a9pa5j/ , check out the console

  • Around gave, I am testing in a file . html on my computer, in this file I put a tag <script> and do my javascript tests, but with this json there does not work.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.