M
M
MAXH02015-01-31 14:28:41
JavaScript
MAXH0, 2015-01-31 14:28:41

How to store code snippets [HTML, CSS, Javascript] in JSON?

In general, this is the question. Not how to parse HTML\JSON
There is a need to store small code snippets of examples. IMHO they would look good in JSON. It is desirable that after storage the appearance (indents, etc. be preserved.) It is also ideal that human intelligibility is preserved during storage, but this is not necessary ... An entire HTML page can also act as a fragment, only VERY small.
On the one hand, itching to write a bicycle, on the other hand, there are most likely standard methods for storing such ...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
IceJOKER, 2015-01-31
@IceJOKER

add backslashes before quotes and store, what's in the way?
{
"html" : ""
}

V
Vladislav Churakov, 2015-01-31
@pioneer32

According to the JSON specification, all characters \n\r\t, etc., in values, must be replaced with the corresponding escape sequences

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question