Ver Mensaje Individual
  #5 (permalink)  
Antiguo 02/02/2011, 00:08
Avatar de anacona16
anacona16
 
Fecha de Ingreso: marzo-2010
Ubicación: Bogota DC
Mensajes: 610
Antigüedad: 14 años, 2 meses
Puntos: 52
Respuesta: Llamar Funcion PHP desde JavaScript

Cita:
Iniciado por arros Ver Mensaje
aqui te dejo un ejemplo:
Código PHP:
Ver original
  1. <body>
  2. // .... here some php lins... variables o some functions....
  3.  
  4. //... maybe some post variables an some new values.... proccessed over post variables....
  5.  
  6.  
  7. <script type="text/javascript">
  8. <?php function test() ?>{
  9. document.getElementById("php_code").innerHTML="<?php for($i=0; $i<10; $i++) echo $i; //maybe a function ?>";
  10. }
  11. </script>
  12.  
  13. <a href="#" style="display:block; color:#000033; font-family:Tahoma; font-size:12px;" onclick="test(); return false;"> test </a>
  14. <span id="php_code"> </span>
  15.  
  16. </body>
  17. </html>
¿Inlcuiste el archivo que contiene la funcion?
Deberia funcionar.