• Jueves 25 de Abril de 2024, 00:12

Autor Tema:  Javascript En Servlet  (Leído 1030 veces)

lulial

  • Nuevo Miembro
  • *
  • Mensajes: 22
    • Ver Perfil
Javascript En Servlet
« en: Miércoles 4 de Agosto de 2004, 13:03 »
0
HOLA

TENGO YO QUIERO METER EN UN SERVLET UN JAVASCRIPT DE UN MENÚ QUE CAMBIA DE COLOR AL PASAR EL RATÓN, ESTE JAVASCRIPT ME FUNCIONA EN .HTM PERO AL METERLO EN EL SERVLET NO TIRA.

JAVASCRIPT EN .HTM
<table width="100%" cellpadding="0" border="0">
<tr>
<td width="31%" onMouseOver="this.style.backgroundColor='#E49147';" onMouseOut="this.style.backgroundColor='#739CE7';" onMouseDown="this.style.backgroundColor='#E49147';"
onMouseUp="this.style.backgroundColor='#E49147';" bgcolor="#739CE7" valign="bottom" height="20" onclick="window.location.href='/'"><a href="/" class="navlink"><font face="tahoma" size="2">   <font color="#FFFFFF">Portada</font></font></a></td>
</tr>
</table>

JAVASCRIPT EN .JAVA (SERVLET)
htmlPage += "<table width='100%' cellpadding='0' border='0'>";
htmlPage += "<tr> ";
htmlPage += "<td width='31%' onMouseOver='this.style.backgroundColor='#E49147';' onMouseOut='this.style.backgroundColor='#739CE7';' onMouseDown='this.style.backgroundColor='#E49147';' ";
htmlPage += "onMouseUp='this.style.backgroundColor='#E49147';' bgcolor='#739CE7' valign='bottom' height='20' onclick='window.location.href='/''><a href='/' class='navlink'><font face='tahoma' size='2'>   <font color='#FFFFFF'>Portada</font></font></a></td>";
htmlPage += "</tr>";
htmlPage += "</table>";

SIENDO htmlPage un String que luego se imprime:
 response.setContentType("text/html");
 out = response.getWriter();
 out.println(htmlPage);

GRACIAS

Un saludo