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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:49:23+00:00 2026-05-23T07:49:23+00:00

When I start my script I have this: var my_great_masterpiece = new function ()

  • 0

When I start my script I have this:

var my_great_masterpiece = new function ()
{
        var self = this;

Then later in my script I have this:

        response_xml: function ()
        {
            if (self.http_request.readyState == 4)
            {
                if (self.http_request.status == 404 && countXmlUrl <= 3)
                {
                    countXmlUrl++;
                    self.realXmlUrl = xmlUrl[countXmlUrl];
                    self.request_xml();
                }
                if (self.http_request.status == 200)
                {
                    self.xmlDoc = self.http_request.responseXML;
                    self.storage.setItem('domains_raw_xml', self.http_request.responseText);
                    self.main.peter_save_data();
                    self.timervar = setTimeout(function ()
                    {
// ########### Below line gives the error #############################
                        self.new_version_show_window();
                    }, 2000);
                }
            }
        },
        new_version_show_window: function ()
        {
...
}

the error that I am getting is:

Error: self.new_version_show_window is
not a function

What am I doing wrong?

Thanks!

  • 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-23T07:49:24+00:00Added an answer on May 23, 2026 at 7:49 am

    It is unclear from your code where new_version_show_window is defined. Maybe you could explicitly define it on self:

    self.new_version_show_window = function () {
        /* ... */
    }
    

    instead. Or you could define it in the local namespace and use it directly in the setTimeout call:

    self.timervar = setTimeout(function () {
        new_version_show_window();
     }, 2000);
    

    or simply:

    self.timervar = setTimeout(new_version_show_window, 2000);
    

    Because of closure, the variables declared in the outer function is also available in the inner function.

    Edit

    Thanks for posting the entire code. new_version_show_window is defined on this.main, so you must access it thusly:

    self.timervar = setTimeout(function () {
        self.main.new_version_show_window();
     }, 2000);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this JavaScript code: <script type=text/javascript> function timeMsg() { var t=setTimeout(doRedirect(),10000); } function
Right now, I have this on my page: <script type=text/javascript> $(document).ready(function () { var
I have this mail script I have to run a few times. To start
I have a simple script which is used to start another program. This other
I have a bash script file which starts with a function definition, like this:
I have this small PHP script: <?php session_start(); $var = array(); $var['key'] = 'Var
I have been trying to make an init script using start-stop-daemon. I am stuck
Is there a way in Firebug to start a new script file to apply
I have an Upstart script for my server that looks like this: description myapp
I have been trying to fix this script for more than an hour and

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.