Ver Mensaje Individual
  #3 (permalink)  
Antiguo 19/04/2018, 14:37
sarrhen
 
Fecha de Ingreso: mayo-2013
Ubicación: San Vicente
Mensajes: 127
Antigüedad: 11 años
Puntos: 1
Respuesta: Como ejecutar una funcion javaScript con php dentro

Utiliza jquery Ajax y coloca un identificador para obtener un elemento del DOM
Código Javascript:
Ver original
  1. <script>
  2.     $(document).ready(function () {
  3.         $("button").click(function () {
  4.             var Correlativo_TD = $("#ELEMENTO DEL DOM").text();
  5.               var parametros = {
  6.                 "Correlativo_Insertar_Ingreso_Inicial": Correlativo_TD
  7.                             };
  8.             $.ajax({
  9.                 data: parametros,
  10.                 url: 'URL DONDE MANDAS ',
  11.                 type: 'post',
  12.                 beforeSend: function () {
  13.                     $("#resultado").html("Ingresando datos");
  14.                     $("#txt_Matriculas_Mas").val("");
  15.                 },
  16.                  });
  17.         });
  18.     });

Yo utilizo esto y me funciona