• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

201
Vistas
How to prevent ajax from confirming on success content already inside a div

How to prevent ajax from confirming on success content already in in this case in $('.Mydiv').Append(data);

$(document).ready(function (ajaxCall) {

    var offset = 0;
    var limit = offset + 4;
    var cats_in_home = '<?php echo $myCat ?>';
    var request_in_progress = false;

    $.ajax({
        type: 'GET',
        url: 'getActivity.php',
        data: {
            'offset': offset,
            'limit': limit,
            'cats_in_home': cats_in_home
        },

        success: function (data) {
            $('.get_communication_with_div_class').html(data);
        }
    });

    $('.MySeconddiv').onclick(function () {

        if (request_in_progress) {
            return;
        }

        request_in_progress = true;

        $.ajax({
            type: 'GET',
            url: 'getActivity.php',
            data: {
                'offset': offset += 6,
                'limit': limit,
                'cats_in_home': cats_in_home
            },

            success: function (data) {
                $('.Mydiv').append(data);
                request_in_progress = false;
            }
        });
    });
});


the problem is when i click the MySeconddiv tag its accept duplicates, plese help i cant find way to find a solution i cant find way to find a solution

over 3 years ago · Santiago Trujillo
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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda