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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:45:46+00:00 2026-06-13T12:45:46+00:00

I am just getting my feet wet where JavaScript Prototyping is involved, and I

  • 0

I am just getting my feet wet where JavaScript Prototyping is involved, and I am having some trouble.

I need to create a _LEAVE object from a LEAVE prototype for a system I am working on based on a prototype object. The _LEAVE object has a function named Ready, which should fire when the document is ready. The system already has similar functionality in some of it’s older code, and I am trying to keep it uniform.

Here is the code I am trying, but I keep getting an error:

var LEAVE = function () {

}

$(document).ready(function () {
    _LEAVE.Ready();
});


var _LEAVE = function (params) {

    this.Ready = function () {
        alert ("Leave Ready");
    };
}

_LEAVE.prototype = new LEAVE();

Error:

SCRIPT438: Object doesn’t support property or method ‘Ready’
leave.js, line 6 character 5

I’m not sure where I am going wrong, as this seems to be what is happening in other parts of the system. At least, something similar is happening, but I am struggling to wrap my mind around the old code…

Would appreciate any advice anyone could give me! 🙂

  • 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-13T12:45:46+00:00Added an answer on June 13, 2026 at 12:45 pm

    I’m not sure if I’ve understood you correctly, but are you attempting to create an instance of a LEAVE object? If so, LEAVE needs to be a constructor function, and Ready should be a method on the prototype of that:

    var LEAVE = function () {};
    LEAVE.prototype.Ready = function () {
        alert("Leave Ready");
    };
    

    Now, you can instantiate LEAVE by calling the constructor with the new operator:

    var _LEAVE = new LEAVE(); // _LEAVE is an instance of LEAVE
    $(document).ready(function () {
        _LEAVE.Ready(); // Ready is a method of `LEAVE.prototype`
    });
    

    Methods declared as properties of the prototype object are shared by all instances. So all instances of LEAVE will have a .Ready method available to them, but they will share one copy of the function in memory (the copy that was assigned to the property of LEAVE.prototype).

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

Sidebar

Related Questions

I am just getting my feet wet with LINQ to SQL, and need some
Just getting my feet wet with some Fluent NHibernate AutoMap conventions, and ran into
I'm just getting my feet wet with Ember.js, and I've hit something that I'm
just getting my feet wet with sql server express. I have what would be
I'm just getting my feet wet with Android and have built a UI that
I'm just getting my feet wet with Linq and IEnumerable, and I'm needing help
I'm just getting my feet wet in Silverlight, and don't really understand the differences
Disclaimer: I'm new to unit testing and just getting my feet wet. That being
I am just getting my feet wet with stored procedures. According to the tutorials
I am an Android developer just getting my feet wet with BlackBerry. I am

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.