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

265
Vistas
How to tell ajax to run particular URL only when a pop up banner is clicked?

I am trying to pop-up a feedback banner, when a particular page is loaded. Here is the code for that.

$(window).on('load', function() {
    $('#review_modal').modal('show');
});

Now I want if someone clicks any button of pop up banner, (either Give feedback or No thanks) it runs a particular URL which only does is (Never show that user feedback again)

Here is my code for that which is wrong.

$(window).on('click', function() {
        $.ajax({
            type: "POST",
            url: "/update_feedback_status",
        });
    });

I am very very new to ajax, but I need this to be done as soon as possible. How should I fix it? HO wto tell ajax that On click means clicking on the button of that popup banner which is #reviewmodal.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You should add the click event listener to the elements in popup model instead of window.

For example:

<div id="review_modal" class="modal">
    <button>Give feedback</button>
    <button>No thanks</button>
</div>

<script>
$('#review_modal button').on('click', function() {
    $.ajax({
        type: "POST",
        url: "/update_feedback_status",
    });
});
</script>
about 4 years ago · Juan Pablo Isaza Denunciar
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