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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:56:37+00:00 2026-06-06T18:56:37+00:00

The first statement which uses this ( line 2 ) errors with: this is

  • 0

The first statement which uses this ( line 2 ) errors with:

this is undefined

Verified the line number. Verified that this style of use works in another function called SMessage. Tried changing the argument name so it was not equal to the object property. Can’t figure out why it won’t make the assignment to this.tag_array. Verified tag_array1 was populated as an array of values.

var VBPaneInit = function ( tag_array1 ) {
    this.tag_array = tag_array1;
    this.initializeTags();
    this.initializePages();

    VBPaneInit.prototype.initializeTags = function( ) {
        var element;
        for ( element = 0; element < this.tag_array.length; element++ ) 
        {
            document.getElementById( this.tag_array[element] ).onclick = vDomPageFlip;
        }
    };
    VBPaneInit.prototype.initializePages = function( ) {
        if ( this.tag_array.length === 0 )
        {
            return;
        }
        var index, page_element;
        for ( index = 0; index < this.tag_array.length; index++ ) 
        {  
            page_element = document.getElementById( this.tag_array[index] + '_page' );
            page_element.style.display = 'none';
        }
        vDomPageFlip( this.tag_array[0] );
    };
};

The Call

VBPaneInit( tag_array );

For testing purposes reduce to :

var VBPaneInit = function( tag_array ) {
    this.tag_array = tag_array;
}

Still no go.

Working Similar:

var SMessage = function ( element ) {
    this.element = element;
    SMessage.prototype.display = function( type ) {
        this.element.innerHTML = this.messages[ type ];
    };
    SMessage.prototype.messages = {
        name:         'Please enter a valid name',
        email:        'Please enter a valid email',
        pass:         'Please enter password, 6-40 characters',
        url:          'Please enter a valid url',
        title:        'Please enter a valid title',
        tweet:        'Please enter a valid tweet',
        empty:        'Please complete all fields',
        same:         'Please make emails equal',
        taken:        'Sorry, that email is taken',
        validate:     'Please contact <a class="d" href="mailto:chris@host.com">support</a> to reset your password',
        s_name:       'Please enter a valid name.',
        s_email:      'Please enter a valid email.',
        s_pass:       'Please enter password, 6-40 characters.',
        s_url:        'Please enter a valid url.',
        s_title:      'Please enter a valid title.',
        s_tweet:      'Please enter a valid tweet.',
        s_empty:      'Please complete all fields.',
        s_same:       'Please make emails equal.',
        s_taken:      'Sorry, that email is taken.',
        s_validate:   'Please contact <a class="d" href="mailto:chris@host.com">support</a> to reset your password.'
    };
};
  • 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-06T18:56:39+00:00Added an answer on June 6, 2026 at 6:56 pm

    There is no this because you’re not saying new VBPaneInit(tag_array), you need the new to create an object.

    Then, your next problem is that you’re not building the prototype correctly in two different ways:

    1. vBPaneInit is not the same as VBPaneInit, JavaScript is case sensitive.
    2. You’re trying to set up the prototype inside the constructor function so it won’t be there the first time you create an object and you’ll be doing it each time you create an object.

    You should be doing something more like this:

    var VBPaneInit = function(tag_array1) {
        this.tag_array = tag_array1;
        this.initializeTags();
        this.initializePages();
    };
    VBPaneInit.prototype.initializeTags = function() {
        var element;
        for (element = 0; element < this.tag_array.length; element++) {
            document.getElementById(this.tag_array[element]).onclick = vDomPageFlip;
        }
    };
    VBPaneInit.prototype.initializePages = function() {
        if (this.tag_array.length === 0) {
            return;
        }
        var index, page_element;
        for (index = 0; index < this.tag_array.length; index++) {
            page_element = document.getElementById(this.tag_array[index] + '_page');
            page_element.style.display = 'none';
        }
        vDomPageFlip(this.tag_array[0]);
    };
    
    new VBPaneInit(tag_array);​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this first Javascript snippet, which only uses var and this to declare scope:
Why does the first if statement evaluate to true? I know if I use
EDIT: My mistake was that I had a go after the first select statement
I have an sql statement that is supposed to return 2 rows. the first
I have this statement which is the wrong way to do it but how
Say that I have one constructor that takes an input and another that uses
This is a generic C++ design question. I'm writing an application that uses a
LINQ uses a Deferred Execution model which means that resulting sequence is not returned
I am writing a web app which uses SQL as input. This SQL must
There is a useful Ruby idiom that uses tap which allows you to create

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.