wso2/jaggery

RD SELECT LAST_INSERT_ID(); reading json contains "()" and reading elements in there give Cannot find function name in object [object Object]. at line

Closed this issue · 1 comments

RD SELECT LAST_INSERT_ID(); reading json contains "()" and reading elements in there give Cannot find function name in object [object Object]. at line

example

<%
var jsonString = '{"name()":"nuwan","company":"WSO2"}';
print(parse(jsonString).name());
%>

In JavaScript, you cannot directly use special object keys after dot notation. You should use square brackets as below.

<%
var jsonString = '{"name()":"nuwan","company":"WSO2"}';
print(parse(jsonString)['name()']);
%>