Ver Mensaje Individual
  #4 (permalink)  
Antiguo 23/11/2012, 08:30
Avatar de Javier01
Javier01
 
Fecha de Ingreso: febrero-2008
Ubicación: Montevideo
Mensajes: 261
Antigüedad: 16 años, 3 meses
Puntos: 31
Respuesta: pasar un parametro en llamada javascript

Buenas tardes,
Yo lo probé y me funciono perfectamente. Tal vez tengas un error javascript en otro lado.
Posteo el código de la prueba.

Código HTML:
Ver original
  1. <!html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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>Titulo</title>
  6.     </head>
  7.     <body>
  8.         <a id="link" name="link" href="prueba.html">Prueba</a>
  9.    
  10.         <script language="javascript">
  11.             var oA = document.getElementById('link');
  12.             idProba = 1;
  13.             oA.setAttribute('href', 'javascript:proba2(' + idProba + ')');  
  14.             function proba2(ida)
  15.             {
  16.                 alert(ida);
  17.             }  
  18.         </script>
  19.     </body>
  20. </html>
__________________
Tomarse un tiempo para redactar correctamente la pregunta, utilizando los signos de puntuación adecuados, es ganar tiempo y calidad en la respuesta.