MyBB Community Forums

Full Version: Uncaught TypeError: $ is not a function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have no idea why it is not working, things such as inline-moderator will not work on the website. I am using a theme from 1.6 but I believe it is working now with the current MyBB version. I am getting the error above as well as Uncaught TypeError: $.cookie is not a function.

headerinclude

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">jQuery.noConflict();</script>

<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/general.js?ver=1603"></script>






<link href='https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700,700italic,300italic,300,400italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="{$mybb->settings['bburl']}/images/Gameshark/font/css/font-awesome.css"></link>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">


<script type="text/javascript">
jQuery.noConflict();
jQuery(function($) {
    $(".clickedbuttons").hide();
    $(".buttons").click(function() {
        $(".sidebar").animate({height: "hide", opacity: 0}, 500,
            function() {
                $(".forums").animate({width: "1024px"}, 500);
            });
        $(this).hide();
        $(".clickedbuttons").show();
        $.cookie("sidebar","collapsed", {expires: 365});
        return false;
    });
    $(".clickedbuttons").click(function() {
        $(".forums").animate({width: "724px"}, 500,
            function() {
                $(".sidebar").animate({height: "show", opacity: 1}, 500);
            });
        $(this).hide();
        $(".buttons").show();
        $.cookie("sidebar","expanded", {expires: 365});
        return false;
    });
    if($.cookie("sidebar") == "collapsed") {
        $(".buttons").hide();
        $(".clickedbuttons").show();
        $(".forums").css("width","1024px");
        $(".sidebar").hide();
    };
});
</script>

<script type="text/javascript">
$(document).ready(function(){
jQuery("dropdownhover").click(function(){
   jQuery$("div.dropdown").css("overflow", "visible");
});
});
</script>
<script type="text/javascript">

   jQuery("expcolimage").click(function(){
        jQuery$("tbody.bodything").css("display", "none");
    });

</script>
<script type="text/javascript">
jQuery(function() {

    var quotes = jQuery(".quotes");
    var quoteIndex = -1;
    
    function showNextQuote() {
        ++quoteIndex;
        quotes.eq(quoteIndex % quotes.length)
            .fadeIn(1000)
            .delay(12000)
            .fadeOut(1000, showNextQuote);
    }
    
    showNextQuote();

});
</script>

<script type='text/javascript'> 
jQuery.noConflict();
jQuery(function() {
jQuery("a").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("title").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("img").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("i").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("span").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("div").tipsy({gravity: jQuery.fn.tipsy.autoNS});
  });
</script>

<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function($) {

    $(".catdesc").hide();

    $(".cattitle").on('mouseover mouseout', function(event) {

        var catdesc = $(this).parent().children('.catdesc');

        var content = catdesc.text();

        if (content !== "") {
            if (event.type == 'mouseover') {
                catdesc.fadeIn('slow');
            } else {
                catdesc.stop(true, true).fadeOut('slow');
            }
        }

    });

});
</script>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function($) {

function DropDown(el) {
	this.dd = el;
	this.initEvents();
		}
			DropDown.prototype = {
				initEvents : function() {
					var obj = this;

					obj.dd.on('click', function(event){
						$(this).toggleClass('active');
						event.stopPropagation();
			});	
			}
		}

			$(function() {
                                var dd = new DropDown( $('#dd') );

				$(document).click(function() {
					$('.wrapper-dropdown-5').removeClass('active');
				});

			});
});
</script>
{$stylesheets}
<script type="text/javascript">jQuery.noConflict();</script>
remove all these: <script type="text/javascript">jQuery.noConflict();</script>
I am having the same problem and this did not work. Sad
you called a function withOUT loading some external JS file?

You might need to upload the rest of the theme folders inc JS's
Sorry just to clarify I cleared up most of the cookie errors but my problem was that inline-moderation isn't working. I also removed some of the jquery links in the header but that seems to have made my current menu thing not work.
from experience you need to load all the standard jquery stuff in the header for the inline editors to work
I've posted my header above can anyone please tell me if there is a problem?