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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:39:01+00:00 2026-05-20T10:39:01+00:00

How do I pass in a variable proxy of the this context of the

  • 0

How do I pass in a variable proxy of the “this” context of the Class instance? For example, this.saySomething() isn’t doing what I’d like it to.

Do you have any other recommendations on OOJS code organization?

// Truveo Video Player Class
function Player(){

    // Player Defaults
    this.opts = {
        volume: 0 // Initial volume settings
    };
}

// Initialize player setup / methods
Player.prototype.init = function(configs){

    // Overwrite defaults with custom configs
    this.opts = $.extend(this.opts, configs);

    $(document).ready(function(){
        this.saySomething();
    });
    $(window).load(function(){
        // do something else
    });
}

Player.prototype.saySomething = function(){
    alert(this.opts.volume);
}

// Create instance for channel surf
var configs = {volume:10};
var cSurf = new Player();
cSurf.init(configs);
  • 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-20T10:39:02+00:00Added an answer on May 20, 2026 at 10:39 am

    Save a copy of this before entering the function:

    var me = this;
    $(document).ready(function(){
        me.saySomething();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to pass a variable to a UIButton action, for example NSString *string=@one;
I need to pass a variable in dispatcher tag... for instance var google:EventName =
I want to ask you , how to pass variable, there's the example: I
I pass a variable to domain.com/index.php?user=username In my page (index.php) contains others pages like
Is there any way to pass variable to the set_exception_handler() method in PHP? I
Hi is there any way for me to pass variable arguments to a method?
I want to pass variable arguments obtained in one function to other function but
I would like to choose which variable to pass to a funciton based on
Hi how i can pass variable into this function var _index = $(#sideNewsContent_menu li).index($(this))
I have a question. It is possible to pass variable to a new page

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.