I'm trying to take the value of a variable and create a javascript array 
with it.  The problem is is that somewhere along the line any double or 
single quotes within the variable are being rendered as HTML special 
characters (i.e. " appearing as ") which obviously screws up building an array.  
As a remedy I tried using 
the String Tag Library's <str:replace> functionality, but with similar 
results, even when escaping the replacing character.  Is there a way to 
render characters such as quotes as quotes? 

Here's what I tried:

<td>
        <c:set var="arie">
                <str:replace replace="&#034;" with="\'">
                        <c:out value="${PayCalendar.sp_day_01}" />
                </str:replace>
        </c:set>
 
        <script language="javascript" type="text/javascript">
                document.write(maritime(new Array(<c:out value="${arie}" 
/>,<c:out value="${thisDay.count}" />)));
        </script>
</td>

here's how it rendered:

1,&#039;&#039;,&#039;&#039;,&#039;Timecard Due&#039;,,1

Thanks,
Jason Slade
Client-Side Developer
Hewitt Associates

Reply via email to