Hi,
I have pasted my code below, please paste it into a JSP and tell me why it gives the error "Unterminated String Constant"
<html>
<head>
<title>Debugging</title>
<script language="javascript">
function changeOn(object, objectId) {
alert('in function');
if (object == 'bookingsButton') {
alert('first if');
document.getElementById(objectId).src = 'Images/BookingsOn.png';
} else if (object == 'detailsButton') {
alert('2nd if');
document.getElementById(objectId).src = 'Images/DetailsOn.png';
}
}
function changeOff(object, objectId) {
if (object == 'bookingsButton') {
document.getElementById(objectId).src = 'Images/Bookings.png';
} else if (object == 'detailsButton'){
document.getElementById(objectId).src = 'Images/Details.png';
}
}
</script>
</head>
<body>
<%
for (int i = 0; i < 2; i++) {
%>
<table>
<tr>
<td>
<a href="Bookings.jsp"><img src="Images/Bookings.png" id="bookings<%out.println("" + i);%>" onmouseover="changeOn('bookingsButton','bookings<%out.println("" + i);%>')" onmouseout="changeOff('bookingsButton','bookings<%out.println("" + i);%>')"/></a>
</td>
<td>
<a href="Details.jsp"><img src="Images/Details.png" id="details<%out.println("" + i);%>"/></a>
</td>
</tr>
</table>
<% }%>
</body>
</html>
Thanks,
-Ashton