I have a user form. If the user types in a string with `'` or `"` as part of it I have no problem. The form is submitted and saved correctly to the database. My problem is when I reload the page (all entries can be modified and are loaded into a list in the JSP before being displayed). On loading the page I get an error saying:
missing ) after argument list 'Caroline's message', \n
What do I need to do to escape this string for displaying it on the frontend?
communications[<%=i%>] = new CommObject('<%=c.getComId()%>', '<%=c.getComName()%>');
**UPDATED WITH HTML GENERATED:**
communications = new CommObject('101', 'Caroline's Message');
What do you mean by messed up? In what way are those characters messed up?