Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

110
Vistas
OnClick doesn't get triggered on reloadig the respective DIV using JQuery get()

I m trying to reload a particular div on a button click using JQuery $.get(), which works perfectly fine. Upon reloading the said div, the Jquery click functions for the div elements don't respond.

Here's the sample code for reference :

Main Page:

<div id="msc-layer-placeholder-wrapper" class="left_bar_menu_div" >
    <?php include("left_menu_detail.php"); ?>
</div>

<a id="audio_upload_submit_btn">refresh</a>

<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script>
$("#audio_upload_submit_btn").click(function(){
  $.get("left_menu_detail.php", function(data){
      $(".left_bar_menu_div").html(data);
  });
});

$("#media_child_library_btn").on("click", function() {
   // Do some thing
})
</script>

left_menu_detail.php

<div>
   <div id="media_child_library_btn">
     some btn
   </div>
</div>

Please note that:

The $("#media_child_library_btn") click function works fine once whole page refreshes, but when i reload the specific div using $("#audio_upload_submit_btn") click function, it stop responding.

Things I tried:

  • Made sure that the $("#media_child_library_btn") click function is at the top
  • used e.stopPropagation(); for $("#media_child_library_btn") click function. No use.

Any help is greatly appreciated.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda