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 6237209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:59:05+00:00 2026-05-24T10:59:05+00:00

I asked a question yesterday, I accepted the answer, but sometime later, I came

  • 0

I asked a question yesterday, I accepted the answer, but sometime later, I came to know that the solution was not complete. The question is :-

Insert a JQuery click handler that executes before the ones already registered

using setTimeout(handler,0); returns immediately and I can not use return setTimeout(handler,0);. How can I run this handler synchronously and not allow the parent function to complete until this handler is completely executed and I get the return value out of it ?

I am in hurry, so I am asking it again, rather than editing that question again.

  • 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-05-24T10:59:06+00:00Added an answer on May 24, 2026 at 10:59 am

    You don’t need to use setTimeout. If u don’t use setTimeout, your handler reamins synchronous, and you can return all the value u want in your function.

    <script>
       function f2() {
          alert('Handler declared in HTML')
       }
    
       buttons = document.getElementsByTagName('input');  // refine this, later
    
       for (i = 0, max = buttons.length; i < max; i++) {
          oldonclick = buttons[i].onclick;
    
          buttons[i].onclick = function() {
             alert('Prepend handler');
             oldonclick();
          }
       }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I asked a question yesterday which got answers but didnt answer the main point.
I asked a similar question yesterday, but recognize that i need to rephase it
I've posted a question yesterday but I just realized that the answer doesn't seem
I asked this question yesterday got a pretty good answer but can't figure out
I asked the same question yesterday and the answer was not applicable. https://stackoverflow.com/questions/6194578/breaking-up-class-functions-into-multiple-cpp-files If
I asked this question yesterday but not sure if I made clear what I
I asked a similar question yesterday that was specific to a technology, but now
I asked a similar question yesterday but I included some code that basically took
i asked this question yesterday but it doesnt seem to have asked properly so
I asked a question yesterday on here and got some awsome help, but I

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.