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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:42:09+00:00 2026-05-28T16:42:09+00:00

I have a document, which has two javascript functions A(); and B(); .The functions

  • 0

I have a document, which has two javascript functions A(); and B();.The functions get called in no particular order, I want to do something upon the last call.

I can accomplish the task by using local variables, but before doing so I’d like to confirm if there’s more elegant/robust way for doing that – I might have more than two such functions, which makes local vars solution a complete mess.

Update 1 – More details

I’ve a few SilverLight plugins on a page, each has

<param name="onLoad" value="pluginLoaded" />

I can’t go any further than “pluginLoaded” no paramters no nothing.

The plugins get loaded in an absolute random order, upon the overall completion I want to call another function.

  • 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-28T16:42:11+00:00Added an answer on May 28, 2026 at 4:42 pm

    We do this by redifining the functions:

    You now have:

    function A() { /* do something */ }
    function B() { /* do something */ }
    function FinalCurtain() { /* do something after A and B have been called*/ }
    

    Just do
    EDIT: After requirement “I’d like doA & doB to be called just once each”

    function DoA() { /* do something */ }
    function DoB() { /* do something */ }
    function DoFinalCurtain() { /* do something after A and B have been called*/ }
    
    function A() {
       DoA();
       B=function() {DoB(); FinalCurtain();}
       A=function() {}
    }
    
    function B() {
       DoB();
       A=function() {DoA(); FinalCurtain();}
       B=function() {}
    }
    
    function FinalCurtain() {
       DoFinalCurtain();
       //Remove next 2 lines if you do NOT want to start the process over once DoFinalCurtain() has beenm called.
       A=function() {DoA();}
       B=function() {DoB();}
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user document which has a group field. This field is an
I have a document library in MOSS 2007 which has folders and files. Document
I have an XML document which looks something like this: <meadinkent> <record> <comp_div>MENSWEAR</comp_div> <sty_ret_type>ACCESSORIES</sty_ret_type>
I have an versioned document store which I want to access through an dict
I have got an XML document which looks something like this. <Root> <Info>....</Info> <Info>....</Info>
I have a (set of) Word document(s) for which I'm trying to get various
Scenario: I have a Question which has 2 radio buttons & two subforms: subformA
I have one webpage (lets call it A.html). A.html has some javascript which switches
I have a form in which I want two check boxes to be required
I have a listbox which has two buttons to control the priority of 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.