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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:50:36+00:00 2026-06-10T01:50:36+00:00

There’s a foreign JS file which is not loaded from our server on my

  • 0

There’s a foreign JS file which is not loaded from our server on my page. In short I dont have any control on that file and I can’t edit the file. I have created 1 function which I wish to call after the function which is in that foreign file is called.

I know the name of function of foreign file. I wish to call my function once the function from foreign file is executed. How can I do it?

Let me know if you dont understand my problem here. I’ll try and explain it again.

Thanks in advance

  • 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-06-10T01:50:37+00:00Added an answer on June 10, 2026 at 1:50 am

    If the foreign function is in the global scope you can replace it with your own wrapper:

    var _old = foreignFunction;
    foreignFunction = function() {
    
        // put pre-call stuff here
        ...
    
        // call with the original context and args
        _old.apply(this, arguments);  
    
        // and post-call stuff here
        ...
    }
    

    Note the use of .apply to ensure that whatever context and arguments were supplied to the original function are still supplied to it. Without that, the this variable inside that function may not be what it’s supposed to be.

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

Sidebar

Related Questions

There's a Rails 3.2.3 web application which doesn't use any database. But in spite
There is a directed graph having a single designated node called root from which
There are two intents on the receiver side which are called from the same
There are numerous Agile software development methods. Which ones have you used in practice
There is a similar question from 2009 which mentions Wufoo and FormAssembly services. Are
There are many questions about this PersistenceException, but I have not seen some, where
There is a tree style structure from which I want to keep only a
There is any way to set the generic type (T) of class in the
I have just tried to save a simple *.rtf file with some websites and
There are several shading languages available today like GLSL, HLSL, CG, which one to

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.