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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:43:05+00:00 2026-06-14T02:43:05+00:00

I recently started using prototyping for a project. It is one of my first

  • 0

I recently started using prototyping for a project. It is one of my first times using prototyping, so still finding my legs 🙂 I come from an object oriented background, so excuse me if some of my terminology is not correct.

One of my main reasons for using it is to create a scoping framework for the project, to avoid any conflicts later on. I also use it to allow me to create objects spread over several files.

I am however having trouble with something.

I declare my base “class” in one file. In another file, I then declare an extension to the class. In this extension I declare a function, which I then try to call from the base class. Lastly I declare an instance of the extension inside the base class to allow me to call the extended functions from the base class.

When I try and create the instance, however, I get the following error:

SCRIPT445: Object doesn’t support this action leave.js, line 2
character 5

Here is a snippet of my code:

leave.js

var _LEAVE = function () {
    this.WORK_LIST = new this._WORK_LIST();
}

worklist.js

_LEAVE.prototype._WORK_LIST = function (params) {
    var Render = function(){
         ...
    }
}

Any suggestions about what I am doing wrong and how to fix it would be greatly appreciated.

  • 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-14T02:43:06+00:00Added an answer on June 14, 2026 at 2:43 am

    Alright, firstly if you don’t understand prototype-based inheritance then I suggest that you learn about it. It’s really simple actually.

    Secondly, and please don’t take this in the wrong way – your code abhors me. I understand that you’ve come from a classical background and I respect the effort you’re making. However, truly speaking I wouldn’t want to read your code even if I was paid to.

    This is what I would have done (correct me if my program isn’t what you’re looking for, but I really don’t know what’s happening in your code):

    // baseClass.js
    
    function BaseClass() {                       // class BaseClass
        var extendedObject = new Extension;
    }
    
    // extension.js
    
    Extension.prototype = new BaseClass;         // Extension extends BaseClass
    Extension.prototype.constructor = Extension; // reset the constructor property
    
    function Extension() {                       // class Extension
        // some private variables
    
        var privateVar = null;
        function privateFunction() {}
    
        // some public properties
    
        this.publicVar = null;
        this.publicFunction = function () {};
    }
    

    In addition, since you’re from a classical background it may help you to write code that’s more in line with the classical style of inheritance. Read this answer. It will help you a lot.

    Edit: Using my script you can create classes in JavaScript as follows.

    baseClass.js:

    /*
        class BaseClass {
            var extension;
    
            function constructor() {
                extension = new Extension;
            }
        }
    */
    
    var BaseClass = new Class(function () {
        var extension;
    
        function constructor() {
            extension = new Extension;
        }
    
        return constructor;
    });
    

    extension.js:

    /*
        class Extension extends BaseClass {
            var secret;
    
            function constructor() {
                secret = null;
            }
    
            this.getSecret = function () {
                return secret;
            };
    
            this.setSecret = function (newSecret) {
                secret = newSecret;
            };
        }
    */
    
    var Extension = new Class(function () {
        var secret;
    
        function constructor() {
            secret = null;
        }
    
        this.getSecret = function () {
            return secret;
        };
    
        this.setSecret = function (newSecret) {
            secret = newSecret;
        };
    
        return constructor;
    }, BaseClass);
    

    You may tinker with the fiddle.

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

Sidebar

Related Questions

I recently started using WPF and the MVVM framework, one thing that I have
I recently started using Mac OS X for a flex/actionscript project and having a
I recently started using C# and WPF for one of my projects. Is there
I have recently started using a shared-host for my clients so see project progress
Ive recently started using Ruby on Rails for a project of mine and have
I've just recently started using VS2008 for a new tools project, and have been
I've recently started using Magento for a client's webshop, and still need to get
I recently started using Rob Conery's Massive for reading from an Oracle database in
I have recently started using PlayN for a hobby project and has now stumbled
I have recently started using R and am still getting used to its data

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.