Ver Mensaje Individual
  #4 (permalink)  
Antiguo 09/11/2010, 06:58
quimfv
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Sabadell
Mensajes: 4.897
Antigüedad: 16 años, 2 meses
Puntos: 574
Respuesta: Aydua con Javascript basico

Todo lo que te llegue de un formulario sera un string.

Cuando ya estas en la variable javascript tienes typeof()

Código HTML:
Ver original
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <title>Documento sin t&iacute;tulo</title>
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  4. </head>
  5.  
  6. <script language="JavaScript" type="text/JavaScript">
  7. var variable="esto es un texto";
  8. document.write(variable+" typeof "+ typeof(variable)+"<br />");
  9. variable="25";//esto tambien
  10. document.write(variable+" typeof "+ typeof(variable)+"<br />");
  11. variable=25;
  12. document.write(variable+" typeof "+ typeof(variable)+"<br />");
  13. variable=location.href;
  14. document.write(variable+" typeof "+ typeof(variable)+"<br />");
  15. variable=Date;
  16. document.write(variable+" typeof "+ typeof(variable)+"<br />");
  17.  
  18. </body>
  19. </html>


Quim

Última edición por quimfv; 09/11/2010 a las 07:06