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

98
Views
reload function but script inside function still execute jquery

i try to making web typing test.
so there is a button to reload function().
this function have script randoming words from string, and validate every user input to randomed words.

the randoming words script works perfectly, but the keyup script still executed.

var StopFunc;
function validationWords(StringFromPool){   
    // randomingWords function here   
    // script for focus to div
    $(".words-pool-container").on("keyup", function(e){
        //script for only accept a-z, space, and backspace
        // script for loop and if input keyup[i] == stringrandomwords[i] 
    })

 StopFunc = setTimeout(function(){validationWords(StringFromPool)}, 600)
}

function domReady(){
    StringFromPool=word();
    validationWords(StringFromPool);
}

$(document).ready(domReady)

$(document).ready(function(){
    // reload function button
    $(document).on("click", "#reload-btn", function(){
        clearTimeout(StopFunc);
        domReady();
    })
})

i do compare userinput and string based index. but when i press button reload, the index like looping. when i press once char, the index jump based on how many i click the reload button.

anyone know what i've missing here?

about 4 years ago · Juan Pablo Isaza
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!