I need to send variables at runtime to a js method for ajax. I am trying with this onclick function but it gives syntax error on click.:
<c:set var="abc" value="${myTaglib:getAbc()}" />
<a href="#" onclick="sendAjax(${abc.firstVal}, ${abc.secVal}, ${abc.thirdVal}, ${abc.fourthVal}, ${abc.fifthVal})"> Click Here !!!</a>
Some of these values may have spaces and decimals in them. On click, I get this error at the first occurrence of space.:
SyntaxError: missing ) after argument list
The actual HTML looks like:
<a onclick="sendAjax(240265, Workplace Ethics Exam, Company Security Policy, Friends Life, ABF/45RFG, 41444.1830)" href="#">Click Here !</a>
What is wrong with this JS call ?