You need to sign in to do that
Don't have an account?

How to replace single quotes with double quotes in JSON. Please help
[{'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'}]
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