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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:24:20+00:00 2026-06-07T21:24:20+00:00

I have what is I believe an extremely basic javascript question that for some

  • 0

I have what is I believe an extremely basic javascript question that for some silly reason I am struggling with.

If you visualise the object below. How would I call one function from inside the ‘init’ function?

TC.design = {

        init : function(){
            //How would I run the loadPage function here? 
        },
        loadPage : function(){

        }
}

I have tried this.loadPage(); which I expected to work but it returns undefined.

I am clearly not grasping something fundamental here, hopefully someone can explain.

EDIT: This is now solved…

Thanks to Joseph Silber and Rocket I have realised my error…

The problem arose due to a misunderstanding of the javascript .call() function. I was calling init with TC.design.init.call() which I now understand is incorrect. My apologies….

  • 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-07T21:24:22+00:00Added an answer on June 7, 2026 at 9:24 pm

    Within your init function, this refers to the TG.design object; this.loadPage() should work, but you have to call the init function properly in order to invoke it.

    Here’s some sample code:

    var TC = {
        design: {
            init: function() {
                this.loadPage();
            },
            loadPage: function() {
                conosle.log('Works');
            }
        }
    };
    
    TC.design.init();​
    

    and here’s the fiddle: http://jsfiddle.net/85AWT/

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

Sidebar

Related Questions

I have a Spring application that I believe has some bottlenecks, so I'd like
I believe I have a potential threading issue. I have a user control that
I have reason to believe console.log and JSON.stringify can produce inconsistent views of the
I have been lead to believe that it is possible to pass a class
I believe this question might have been previously attempted in 2006 on a different
Please don't laugh at me but I believe that I just did something extremely
I have an algorithm that attempts to solve SAT, and I believe it always
I believe this is not a duplicate question, I have seen all questions/answers before
I believe I have disabled the view state on all controls as well as
I believe I have found a weird bug as follow: I want to delete

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.