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

115
Views
Jquery alert dispara dos veces en lugar de una vez con php

Estoy trabajando con jquery y php. En este momento tengo el botón "Editar", pero cada vez que hago clic en el botón recibo una "alerta" dos veces en lugar de una vez. Aquí está mi código html (dentro de la etiqueta php)

 <?php $PostComment2='<div class="button1'.$CommentID.'"> <span name="MaxValue" value='.$CommentID.' data-val='.$CommentID.' id="MaxValue" class="edit_post_comment"> Edit2 </span></div>'; ?>

Aquí está mi guión

 <script> $(document).ready(function(){ $(document).on('click','.edit_post_comment',function(e){ e.preventDefault(); alert('Hello world'); //further code... }); }); </script>

¿Cómo puedo alertar una sola vez en lugar de dos veces, donde me equivoco?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

¿Puedes estar usando la clase dos veces en el cuerpo? Por favor, compruebe. Puede intentar usar id.

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!