Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Oct 2011
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    $ is not a function error

    Complete coding novice here, but I'm getting this error twice on my site (insidethehall.com) in Firebug. Appears to be lines 175 and 712 in the code.

    Noticed this because the tabbed sections in my right sidebar have completely stopped working and I just get javascript:void(0) when I try to click them. For example, under resources section in right sidebar, try clicking "Blogroll" or "Big Ten."

    Any help or suggestions would be appreciated. Thanks.

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,086
    Thanks
    38
    Thanked 498 Times in 492 Posts
    Without seeing any of your code, which you have not decided to post,
    my SWAG is that you are trying to use a JQuery function without
    having the JQuery library loaded and available.

  • Users who have thanked jmrker for this post:

    pabozich (10-23-2011)

  • #3
    New to the CF scene
    Join Date
    Oct 2011
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jmrker View Post
    Without seeing any of your code, which you have not decided to post,
    my SWAG is that you are trying to use a JQuery function without
    having the JQuery library loaded and available.
    Here's are the code snippets it points me to in reference to the error:

    Code:
    <script type="text/javascript">
    $('#searchform span.mag').click(function(e) {
    $('#searchform').submit();
    });
    </script>
    and

    Code:
    <script type="text/javascript">
    $(function() {
    $('.tabbedContainer .tabs li:first-child a').addClass('active');
    //$('.tabbedContainer .tab-content:first-child').css('display','block');
    $('.tabbedContainer .tabs li a').click(function(e) {
    e.preventDefault();
    var idPieces = $(this).attr('id').split('a-');
    var parentClass = $(this).parent().attr('class');
    /* console.log(idPieces[1]);
    console.log('hidding: ' + parentClass + '-container'); */
    $('#' + parentClass + '-container .tab-content:visible').css('display','none');
    $('#' + idPieces[1]).css('display','block');
    $('#' + parentClass + '-container .tabs li a.active').removeClass('active');
    $(this).addClass('active');
    });
    $('.tabbedContainer .tabs li a#a-tab-crean').unbind().click(function(e) {
    $.getJSON(
    'http://twitter.com/statuses/user_timeline/tomcrean.json?callback=twitterCallback2&count=5',
    twitterCallback2
    );
    });
    });
    </script>

  • #4
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,086
    Thanks
    38
    Thanked 498 Times in 492 Posts
    I personally know very little about JQuery, if that is indeed the code your are using.

    However there is another area of this forum, "Javascript Frameworks", where you
    might receive a more complete answer to your question.
    See: http://www.codingforums.com/javascript-frameworks/
    or see top of previous page.

    Hope that helps.

  • #5
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,676
    Thanks
    6
    Thanked 1,008 Times in 981 Posts
    If you get “$ is not a function” then you probably haven’t included the jQuery core framework before the call of that function. Can you show us a link to your page or post the source code here?

  • Users who have thanked VIPStephan for this post:

    pabozich (10-23-2011)

  • #6
    New to the CF scene
    Join Date
    Oct 2011
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by VIPStephan View Post
    If you get “$ is not a function” then you probably haven’t included the jQuery core framework before the call of that function. Can you show us a link to your page or post the source code here?
    Thanks for the reply. The URL of the page is insidethehall.com. I've got this reference for jQuery in my header:

    Code:
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" language="javascript" type="text/javascript"></script>
    The main thing I'm trying to fix are the tabs in the sidebar under the "Recruiting" section. They had been working for two years, but are no longer working. My novice guess is an error elsewhere is throwing it off.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •