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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:04:05+00:00 2026-06-06T04:04:05+00:00

I am using a jQuery Class plugin as so : jQuery(document).ready(function($) { window.SSK.calendar =

  • 0

I am using a jQuery Class plugin as so :

jQuery(document).ready(function($) {
    window.SSK.calendar = new(Class.extend({
    filter_by_filtered_names: function() {
      console.log('foobar!');
    },
      init: function() {
        if ( window.location.href.match(/name_filters/) ) {
          SSK.calendar.filter_by_filtered_names();
        };
      }
    }))
});

For some reason this returns on load :

SSK.calendar is undefined

Which tells me that the plugin class is not loading before its own call. Very strange indeed. Curious if anyone knew a remedy?

  • 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-06T04:04:07+00:00Added an answer on June 6, 2026 at 4:04 am

    The behaviour seems to make perfect sense to me, even if I don’t know how Class works:

    Class.extend(...) creates a new constructor function (I assume). new executes the constructor which in turn calls init. The result is assigned to window.SSK.calendar. You see, init is called upon instantiation and this happens before the instance is assigned to window.SSK.calendar.

    Here is a simplified example:

    function MyClass() {
        this.bar = 'baz';
        console.log(foo.bar);
    }
    
    var foo = new MyClass();
    

    This will fail since foo is still undefined at the moment the constructor is called. The instance is the return value of the function call, hence foo cannot contain a reference to the instance before the call.

    You might be able to solve your problem by simply using this to reference the instance:

    init: function() {
        if ( window.location.href.match(/name_filters/) ) {
        // better in this case: if(/name_filters/.test(window.location.href))
            this.filter_by_filtered_names();
        };
    }
    

    The documentation of the plugin should mention how you can reference the instance from inside a method.

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

Sidebar

Related Questions

I'm using the jquery tokeninput plugin from loopj.com Here is my JS File: $(document).ready(function()
I'm using jquery.rating.js plugin and I wrote a litle function that shows the value
<script type=text/javascript> var $j = jQuery.noConflict(); $j(document).ready( function(){ //is this right syntax for jquery
This is my jQuery code: $(document).ready(function() { $(.bottommrg).mouseenter(function() { $(.bottommrg).animate({ marginTop: '-20px' }, {
Using jQuery in IE8, I'm creating a div with a class (ex. <div class=className></div>
I want to get the class name using jQuery And if it has an
I'm looking for a way using jquery/javascript to get a class name when I
How to select next n hidden elements that have class foo using jQuery?
Using class name I am firing a click event in jquery. Class names are
I'm using (trying to use) jQuery to add a class to the first paragraph

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.