Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9056939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T14:19:33+00:00 2026-06-16T14:19:33+00:00

I have the following code: var wait = 500; $(document).on(click,.new_game_list_row,function(event){ var self = $(this);

  • 0

I have the following code:

var wait = 500;
$(document).on("click",".new_game_list_row",function(event){
        var self = $(this);
        //As the element clicked on has it's data attributes defined
        //Retrieves it when the element is clicked on
        var id_quiz_list = self.data('quizlistId'),
            difficult = self.data('difficult');
            userid = $("#new_game_list_wrap").data('userid');
                setTimeout(function(){
                    $.post("new_game_add.php","userid="+userid+"&id_quiz_list="+id_quiz_list+"&difficult="+difficult,function(data){
                        $answer = data;
                        $("#new_game_list_wrap").fadeOut("slow",function(){
                            self.remove();
                            $("#quiz_list_wrap").append('<div class="quiz_list_row" data-quizlist-id="'+id_quiz_list+'" data-quizlevel-reached="0" '+
                            '><div class="inline list_cell" id="quiz_list_cell_rownew_id1">Quiz '+id_quiz_list+'</div><div '+
                            'class="inline list_cell" id="quiz_list_cell_rownew_id2">Current level: 1</div>');
                            showtrick(id_quiz_list,1);
                        }); 
                    }, "html");  
                }, wait);
    });

I’m trying to use setTimeout() to avoid multi clicks on the row. My table is getting full of ghost entries.

I tried delay but it haven’t work.

Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T14:19:34+00:00Added an answer on June 16, 2026 at 2:19 pm

    I solved with this:

    var isClickable=true, wait = 500;
    $(document).on("click",".new_game_list_row",function(event){
    
        if(isClickable) {
            isClickable = false;
            var self = $(this);
            //As the element clicked on has it's data attributes defined
            //Retrieves it when the element is clicked on
            var id_quiz_list = self.data('quizlistId'),
                difficult = self.data('difficult');
                userid = $("#new_game_list_wrap").data('userid');
                $("#new_game_list_wrap").fadeOut("slow");
                $.post("new_game_add.php","userid="+userid+"&id_quiz_list="+id_quiz_list+"&difficult="+difficult,function(data){
                    $answer = data;
                        self.remove();
                        $("#quiz_list_wrap").append('<div class="quiz_list_row" data-quizlist-id="'+id_quiz_list+'" data-quizlevel-reached="0" '+
                        '><div class="inline list_cell" id="quiz_list_cell_rownew_id1">Quiz '+id_quiz_list+'</div><div '+
                        'class="inline list_cell" id="quiz_list_cell_rownew_id2">Current level: 1</div>');
                        showtrick(id_quiz_list,1);
                }, "html"); 
                    setTimeout(function(){
                        isClickable = true;
                    }, wait);
        }
    });
    

    Problem solved.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: $('#DoButton').click(function (event) { event.preventDefault(); $(input:checked).each(function () { var id
I have the following piece of code: function checkAmount() { var PayField = document.getElementById('paymentamount');
I have the following jQuery code: $('.save').submit(function(e){ var formElement = $(this); var data =
I got a problem, I have this code: $(document).ready(function(){ /* The following code is
I have the following code: var submitHandler = function ($link, $form, close) { var
I have the following code: var refreshId = setInterval(function() { $(#footad).html('myjshere'); }, 15500); Where
Say you have the following piece of code: function someProcess() { var deferred =
I have the following jQuery code: var id = $(this).data('id'); if ($('#container').is(':visible')) { $('#container').slideToggle('fast',
I have the following code: function submitHandler($link, $modal, close) { var $form = $modal.find('#main-form');
i have the following code that opens a dialogue with a View. $('.bulkEditlink').click(function ()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.