javascript - JSON.parse error when using multilayered error -


i following error when trying run json.parse

{"documents": [{"documentid": "1","fileextension": "pdf","name": "top_level_agreement.pdf"}]},{"email subject":"docusign-top level agreement"},{"envelope reciepients":[{"carboncopies":[{"carboncopy1":[{"email":"zabie@toplevelstaging.com","name":"zabie sahial","recipientid":"2"}]{"signers":[+ 

syntaxerror: unexpected token , in json @ position 93 @ object.parse (native) @ object. (/home/toplevelstaging/toplevel

here code

  var envelope_definition = [];     envelope_definition[0] = '{"documents": ['+     '{"documentid": "1","fileextension": "pdf","name": "top_level_agreement.pdf"}]}';     envelope_definition[1] = '{"email subject":"docusign-top level agreement"}';     envelope_definition[2] = '{"envelope reciepients":['+         '{"carboncopies":['+             '{"carboncopy1":['+                 '{"email":"zabie@toplevelstaging.com","name":"zabie sahial","recipientid":"2"}]'+         '{"signers":[+'             '{"signer1":['+                 '{"envelopetabs":['+                     '{""}]"}]}]}}]}';       data = json.parse(envelope_definition);     console.log(data); 

all need is

var data = {"documents": [   {"documentid": "1","fileextension": "pdf","name": "top_level_agreement.pdf"}]},   {"email subject":"docusign-top level agreement"},   {"envelope reciepients":[     {"carboncopies":[{"email":"zabie@toplevelstaging.com","name":"zabie sahial","recipientid":"2"}],     {"signers":[{"signer1":[{"envelopetabs":[{}]}]}]}}]}; 

(or that). javascript natively supports object definition via literal syntax. that's json comes from; that's why it's called "javascript object notation".


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -