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 a stupid question but how does one actually run the 'Build'
This is a very simple question, and I apologize for being so noobish :/
I have a question that's so simple I cannot believe I can't answer it
Continuing on from ideas in: Are there any provable real-world languages? I don't know
Although the title is part of my question, the second part won't be as
I'm using Paperclip and s3 to upload a simple Image file on article. I've
I'm working with ASP.NET MVC 2 and building a simple business app. Here are
I've seen various MVC frameworks as well as standalone ORM frameworks for PHP, as
I have been working with Entity Framework 4 recently, and am slightly confused as
I'm working with some multi-gigabyte text files and want to do some stream processing

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.