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

  • Home
  • SEARCH
  • 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 6745377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:11:50+00:00 2026-05-26T12:11:50+00:00

I am working with a user control that has set of javascript functions that

  • 0

I am working with a user control that has set of javascript functions that are called when an action is performed. This user control is used in a lot of places in the application.

When one of the inbuilt JS function completes execution, I need to fire a custom JS function on my page.

Is there a way for me to attach a function to be fired when another function completes execution? I don’t want to update the inbuilt JS function to call this page JS function.

Hope this makes sense.

  • 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-26T12:11:51+00:00Added an answer on May 26, 2026 at 12:11 pm

    There are a couple design patterns you could use for this depending upon the specific code (which you have not shared) and what you can and cannot change:

    Option 1: Add a callback to some existing code:

    function mainFunction(callbackWhenDone) {
        // do other stuff here
        callbackWhenDone();
    }
    

    So, you can call this with:

    mainFunction(myFunction);
    

    Option 2: Wrap previous function:

    obj.oldMethod = obj.mainFunction;
    obj.mainFunction = function() {
        this.oldMethod.apply(this, arguments);
        // call your stuff here after executing the old method
        myFunction();
    }
    

    So, now anytime someone does:

    obj.mainFunction();
    

    it will call the original method and then call your function.

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

Sidebar

Related Questions

I'm working on a custom user control that essentially displays a name value pair
I currently have a user control that is used on both an /Address/Edit and
It seems to me that Response.Cache.SetVaryByCustom(mykey); is not working from within ASCX User Controls.
I'm trying to get a user control working asynchronously, yet no matter what I
I am currently working within a WPF user control (the root element of my
I'm working on a WinForms app and I have a user control in it.
I have a user control with a ComboBox and a TextBox. Everything is working
I'm working with an ActiveX control placed on a winform. I'd when the user
I'm working on a view-based iPhone app that has the following flow: search ->
I am working on robot which has to control using wireless serial communication. The

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.