I have stored json string in my db field like following which is a valid json:
{"contact_person_name":"abcd","address_line1":"line1","address_line2":"line2","postal_code":"1111","country_id":"2","state":"someState","city":"someCity"}
when I am trying to pass this json string variable requestData.fields_values in a function parameter it is being printed in console like following while clicking the anchor tag:
literal not terminated before end of script
my JavaScript function is following:
function performChangeRequest(vendorId, requestedData){
console.log('data: ' + requestedData);
}
I am appending dynamically data like following:
<a href="javascript:performChangeRequest('${requestData.vendor_id}', '${requestData.fields_values}' )"></a>
If I print the first variable vendorId it is working fine.
Any help? I have tried looking around