Skip to main content
[{'InvoiceNumber':'DRAFT-0000007','ErrorDescription':'2130701-Customer Account Number doesn't exist in SAGE metadata'},{'InvoiceNumber':'DRAFT-0000166','ErrorDescription':'1778001-Customer Account Number doesn't exist in SAGE metadata'},{'InvoiceNumber':'DRAFT-0000000','ErrorDescription':'2281401-Customer Account Number doesn't exist in SAGE metadata'}]
2 Antworten
  1. 13. März 2020, 10:49
    Hi Slmmy, 

    You can try using .replace to replace single quotes with double quotes while parsing JSON

    Here is an example:

    If "captcha_settings" is using single quotes, we replace the single quote with a double quote by adding .replace as follows

    JSON.parse(document.getElementsByName("captcha_settings")[0].value.replace(/'/g, '"'));

    Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

    Thank you