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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:50:40+00:00 2026-06-17T19:50:40+00:00

The website uses onLoad to load a JavaScript file ( .js ). I want

  • 0

The website uses onLoad to load a JavaScript file (.js).
I want to change one of the functions inside that js file using JavaScript.

The function is called “Hello13” and is among many other functions (hello5, hello6, etc..)

The Hello13 function looks something like this:

function hello13(x, y, z) {
    if (x == null) {
        //something, something.
    }
    if (y == null) {
        //something else, something else.
    }
    if (z == null) {
        //something diffrent, something diffrent.
    }
}

So as you can see, when the function is called it is given some values (x, y, z).

I want to “hard code” the z to be my own value (inside the js file).

So it would be something like this after i have Programmatically changed it:

function hello13(x, y, z) {
    z = MyValueOverride.
.....

How can i add my own “z” value inside the js file, After the site has loaded, using JavaScript?

  • 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-17T19:50:41+00:00Added an answer on June 17, 2026 at 7:50 pm

    If it’s a globally defined function in some javascript that is loaded via an inline script tag (either locally defined or in an external JS file), you can just redefine it with your own version of that function. Whichever definition comes last will be the active one.

    So, it sounds like what you want to do is to provide your own definition right after the external JS file containing the target function. That way your definition will replace the original one. If you want to retain the original one, you can assign it to another variable name before replacing it.

    // save original function reference (if desired)
    var originHello13 = hello13;
    
    // now define the new function which will replace the previous definition
    function hello13(x, y, z) {
        z = MyValueOveride...
    }
    

    If the external javascript file is dynamically loaded, then things are a little more complicated because you will need to figure out how to know when the dynamically loaded external JS file has been loaded so you can then define your override. You’d have to show us more about how the external JS file is loaded for us to offer specifics on how to do that.

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

Sidebar

Related Questions

I have a website that uses the JavaScript SDK, and I have a facebook
I have a website that uses basic ASP.Net forms authentication. In the web.config file
I have an external JS file that I load into my HTML <script type=text/javascript
My website uses one image to load a gallery. In the old version of
Currently our website uses links to allow the user to change their locale. The
I have a website that uses JSP as its view technology (and Spring MVC
I have a website which uses Spring Security. I have realized that when I
My website uses linq-to-sql to load about 50k rows of data from a database.
A plugin which I need to implement in other website uses some jquery functions.
I'm writing a python script that scrapes a website, where the website uses OpenID

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.