Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

96
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

9 months ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos