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

248
Views
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 4 years ago · Santiago Trujillo
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!