Answer the question
In order to leave comments, you need to log in
(JQuery) How to remove quotes from a ready array or add unquoted objects to it?
Good afternoon, here is the code described below
No, it is not there, it is rather crutch.
As a result of its work, the following data array is obtained:
[
"{"descr":"Description","itemname":"Milkshake1111 (150 ml.)"," count":"2","price":"40"}",
"{"descr":"Description of another cocktail","itemname":"Mctail12221 (250 ml)","count":"3", "price":"60"}"
]
So, tell me, please, how can I remove the quotes at the beginning and at the end of each element,
that is, I need to get rid of " { - from this quote, and from this - } " , or,as an option, is it possible to add data to the array without them, so that they remain inside each block?
As a matter of fact, I already sang it. he became even more crutch, but now everything works, tomorrow I'll cut it. or not
Answer the question
In order to leave comments, you need to log in
var pars=$.parseJSON(data);
jsonObj.push(data);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question