Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/09/2012, 01:29
Avatar de totti026
totti026
 
Fecha de Ingreso: junio-2011
Mensajes: 150
Antigüedad: 12 años, 10 meses
Puntos: 4
Pregunta pasar variable de php en funcion javascript

hola que tal, estoy implementando un autocompletado y quisiera mandar una variable de php dentro de esta funcion...

Código PHP:
Ver original
  1. <?php
  2. $id=$_GET['id']; //la recibo desde otro php
  3. ?>
  4. <html>
  5. <head>
  6. <script type="text/javascript">
  7. $().ready(function() {
  8.     $("#partida_presupuestal").autocomplete("pagina.php", {
  9.         size: 65,
  10.         matchContains: true,
  11.         //mustMatch: true,
  12.         //minChars: 0,
  13.         //multiple: true,
  14.         //highlight: false,
  15.         //multipleSeparator: ",",
  16.         selectFirst: false
  17.     });
  18. });
  19. </script>
  20.  
  21. </head>
  22. .
  23. .

lo estoy intentando asi, pero no se si es correcto porque no me funciona o no se que ande mal:
Código HTML:
Ver original
  1. <script type="text/javascript">
  2. $().ready(function() {
  3.     $("#partida_presupuestal").autocomplete("pagina.php?id=<? echo $id; ?>", {
  4.         size: 65,
  5.         matchContains: true,
  6.         //mustMatch: true,
  7.         //minChars: 0,
  8.         //multiple: true,
  9.         //highlight: false,
  10.         //multipleSeparator: ",",
  11.         selectFirst: false
  12.     });
  13. });