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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:51:19+00:00 2026-06-12T15:51:19+00:00

My application is accessing a third party external JavaScript file that I cannot alter.

  • 0

My application is accessing a third party external JavaScript file that I cannot alter.

Within the file is an object defined similarly to as follows:

object_1 = (function(){
    var object_1_var = 'object_1_var_value';
    return {
        obj_1_func: function() {
            console.log(object_1_var);
        }
    }
})(window);

I need to be able access the object_1_var within the object, but I’m struggling to access it.

object_1.v // returns undefined
object_1.obj_1_func() // returns the value via console, but I need to assign it to a var.

I have tried extending the object using as follows: (Using jQuerys $.extend())

object_2 = (function(){
    return {
        obj_2_func: function() {
            return object_1_var;
        }
    }
})(window);

$.extend(object_1, object_2);

var my_var = object_1.obj_2_func(); // returns 'Uncaught ReferenceError: object_1_var is not defined'

What can I do to be able to access object_1_var?

  • 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-12T15:51:20+00:00Added an answer on June 12, 2026 at 3:51 pm

    You will not be able to access the variable. It happens to be a private member. Private members of an object can be accessed only by its member functions.

    Read this.

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

Sidebar

Related Questions

Can I store something in HttpContext.Current.Application[MyData] accessing that from javascript?
I am writing an application that is accepting POST data from a third party
I'm working on a vb.net application that interacts with a (third party provided) web
I am creating a web application that is accessing a SQLite database in the
I have created one application in flex that is accessing the Java webservice using
I need to make sure that every users accessing my web application can do
I have a large C++ application on Linux with many first party and third
I ran into an issue with some third party software that we use to
I have to communicate with a third party application and the only way to
I'm working on an application where third party developers will be able to write

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.