Ver Mensaje Individual
  #4 (permalink)  
Antiguo 15/12/2011, 16:10
Avatar de jor_0203
jor_0203
 
Fecha de Ingreso: octubre-2011
Ubicación: mexico
Mensajes: 760
Antigüedad: 12 años, 5 meses
Puntos: 8
Respuesta: diferencias entre undefined, variable cero y valor nulo

pero si mando esto
¿que es lo que estoy mandando?
undefined,null, o cero
como funciona esto en lenguajes diferentes
uno es php y el otro es javascript



Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Documento sin t&iacute;tulo</title>
  6. </head>
  7. <body>
  8. <form action="t.php" method="get">
  9. <input name="e" type="text" />
  10. <input name=""  type="submit" />
  11. </form>
  12. <?php
  13. $que_valor_mande = $_GET['e'];
  14.  echo $que_valor_mande;
  15.   ?>
  16.  
  17.    
  18. </body>
  19. </html>

Código Javascript:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Documento sin t&iacute;tulo</title>
  6. </head>
  7. <body>
  8.  
  9. <form id="form1" name="form1" method="post" action="">
  10. <input  id="ca" type="text" value=""  />
  11. <input name="" type="button" onclick="a()" />
  12. </form>
  13.  
  14.  
  15. <script type="text/javascript">
  16. function a(){
  17. alert(document.getElementById('ca').value);
  18. }
  19. </script>
  20.  
  21.  
  22.  
  23. </body>
  24. </html>

Última edición por jor_0203; 15/12/2011 a las 17:08