I am using the DataTables for viewing data in table form. I am sending the data as a list of objects from the backend(JAVA). I need to retrieve the object Ids as a single string on front end and iterate on them.
For that, in iteration of the data I have concatenated the id with a separator, as
<c:set var="tagIds" value="${tag.id},${tagIds}"/>
The id String is created, what I thought - but I cant use in the JavaScript
In Javascript, I declared a variable as follows
var tagIds = ${userId};
this reflects that Syntax error. This assumes that after comma(,) it is a new variable. I am unable to pass that variable.
Also, I tried sending these values as parameter in javascript function call, but resulting in the same error.
saveTags(${userId}); & saveUploadedTags(<c:out value='${userId}'/>);
Result
Error:
SyntaxError: identifier starts immediately after numeric literal
saveTags(4028808241a34ba60141a35049380000)