S
S
slowkazak2014-12-17 22:27:51
JavaScript
slowkazak, 2014-12-17 22:27:51

(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

2 answer(s)
A
Azim Kurt, 2014-12-17
@slowkazak

Press this key
images?q=tbn:ANd9GcQqiybXwzVwUSPE3uKVnoX

B
Boris Benkovsky, 2014-12-17
@benbor

var pars=$.parseJSON(data);
        jsonObj.push(data);

Does the IDE tell you anything? There, not used variables, for example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question