How do I pass a JSTL object to JavaScript? I see how to pass simple values, but when I try to pass the object so that JavaScript can do something with the object's fields, it gets a syntax error trying to handle the
string version of the object.
So I have an Employee object that I want to pass to a JavaScript function and do something with it (clearly this is a bare-bones
test, not a useful app).
When I click the checkbox the action fails with"
Employee is not defined
[Break On This Error] testObject(Employee[id = 1, fi... John, lastName = Doe, zip = 12345]);
Depending on what I have in the Employee.toString, I have also seen:
missing ] in index expression
Clearly the function is receiving emp.toString, not emp, the Employee object. How can you instead pass the object to the JS function?