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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:34:31+00:00 2026-05-16T08:34:31+00:00

Ok, this is a very simple question. I am actually 90% sure I know

  • 0

Ok, this is a very simple question. I am actually 90% sure I know the answer, but the late hour is causing me to completely space it. I’ve searched it on SO and Google to no success.

How do I get return data from an event handler function?

I have several nests of event handlers, and need to get the result from the deepest out to the main output.

Like so (pseudocode):

mainFunction = function() {

    attachToEvent( 'event1', function( e1 ) {

        e.attachToEvent( 'event2', function( e2 ) {
            return e2.status;
        }

    }
}

console.log( mainFunction() );

What is the proper pattern to get that return data(e2.status) out to the console?

Again, I apologize for the simplicity of this question.

Thanks

  • 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-16T08:34:32+00:00Added an answer on May 16, 2026 at 8:34 am

    You could either just log in the event handler or pass a callback into main function.

    mainFunction = function(callback) {
    
        arg.attachToEvent( 'event1', function( e1 ) {
    
            e.attachToEvent( 'event2', function( e2 ) {
                callback(e2.status);
            }
    
        }
    }
    
    mainFunction( function (e) { console.log(e); } );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may be very simple question,But please help me. i wanted to know what
I'm sure this is a very simple question, but embarrassed to say I can't
This may be a very simple question, but at the moment I don't actually
i have a very simple question, actually this is not the question, this is
This is a very simple question for compiler guys, but I always get confused
This is a very simple question, but I can't seem to find something about
This is a very simple question and I feel stupid for asking it, but
Actually, I have a design question here. Its very simple but the point is:
I think this has to be a very simple question but I am not
This should be very simple question. There are many programming languages out there, compiled

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.