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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:53:29+00:00 2026-06-18T18:53:29+00:00

Can’t figure out these uncaught type errors? I am just trying to use a

  • 0

Can’t figure out these uncaught type errors? I am just trying to use a simple jQuery counter plugin… Other plugins on my site work fine :-/

Errors:

Uncaught TypeError: Cannot set property 'counter' of undefined
Uncaught TypeError: Object [object Object] has no method 'counter' 

On my page I have a span like this:

<span class="counter counter-analog2" data-direction="up" data-format="23:59:59.9" data-stop="00:00:10.0" data-interval="100">0:00.0</span>

I’ve included the jQuery plugin & css files ABOVE where I initialize them from:

<script type="text/javascript" src="/templates/ja_wall/js/jquery.counter.js"></script>
<link rel="stylesheet" href="/templates/ja_wall/css/jquery.counter-analog2.css" type="text/css" media="all" />

Then in my jQuery document ready (which is lower in the code than the plugin include) I initialize the counter plugin like so:

$('.main_counter').counter({}); 

I’m totally stuck… maybe its something to do with jQuery needing no-conflict mode? Any help 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-18T18:53:31+00:00Added an answer on June 18, 2026 at 6:53 pm

    Looks like there is another library which is overriding the $ variable.

    The counter plugin implementation seems to be having some problem. In jQuery
    plugin development it is common practise not to use the $ variable directly but use jQuery variable and use a self executing anonymous function to inject it.

    In your case one solution can be to change the following line in the jquery.counter.js

    !(function (context, definition) {
      if (typeof define == 'function' && typeof define.amd  == 'object') define(['jquery'], definition);
      else definition(context['$']);
    }(this, function ($) {
    

    to

    !(function (context, definition) {
      if (typeof define == 'function' && typeof define.amd  == 'object') define(['jquery'], definition);
      else definition(jQuery);
    }(this, function ($) {
    

    You are using both jQuery and mootools both uses the $ variable to access the core engine. Since you have included the mootools library first and jQuery second, jQuery overrides the $ variable but any call to jQuery.noConflict() will reinstate the initial value.

    In your case the k2.noConflict.js file is calling var $K2 = jQuery.noConflict(); which replaces the original value of $ which is mootools in your case.

    Since you have called jQuery.noConflict() the $ variable will point to mootools, so if you want to access jQuery you need to use the variable jQuery or $K2.

    The normal way of writing a plugin is as

    (function($){
        $.fn.x=function(){
            ..... 
        };
    })(jQuery);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone help me trying to find out why this doesn't work. The brushes
Can someone help me figure out why my logo image isn't resizing according the
Can I authenticate with just Google account username and password instead of using OAuth?
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
Can anybody tell me a regular expression to use within some PHP to find
Can I continue to use the interbase vcl components in delphi 2010 with firebird
Can anyone tell me what i am doing wrong? I am trying to get

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.