Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

196
Views
ckeditor - cómo hacer un cambio desde el editor a una función php

Necesito llamar a una función php desde que sospecho que es una llamada ajax. Tengo ckeditor y necesito atrapar cualquier movimiento del teclado y creo que onchange lo hará. Luego, necesito ejecutar una función para evitar que se agote el tiempo de espera, ya que sospecho que el programa puede agotarse si el usuario permanece en el editor demasiado tiempo.

 <textarea required cols='80' rows='9' class='ckeditor' name='email_text_editor' id='email_text_editor1' placeholder='Body text' onchange='updateTimer(this.value);'><?PHP print $email_subs_rem; ?> </textarea> function updateTimer(myValue) { //sessionTimeoutUpdate();// php function //console.log(myValue); //$.ajax({ // type: "GET", // url: "dummy.php", // data: "mainid =" + id, // success: function(result) { // $("#somewhere").html(result); // } //}); } </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puedes hacer algo como esto...

 function updateTimer(myValue) { //sessionTimeoutUpdate();// php function console.log(myValue); $.ajax({ type: "GET", url: "dummy.php", data: {"mainid =" + id, action : "updateSession"}, success: function(result) { $("#somewhere").html(result); } }); }

archivo PHP

 <?php if(isset($_GET['mainid'])){ if($_GET['action']== "updateSession"){ sessionTimeoutUpdate();//function you wanna call } } function sessionTimeoutUpdate(){ //Do your task here //After done echo "done"; } ?>

Dado que no hay forma de llamar directamente a una función php en el lado del cliente sin solicitud, AJAX es muy útil aquí.

Comenta abajo para cualquier consulta.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!