Object has no method 'flexslider'
Asked Answered
T

3

2

I am trying to set up 'flexslider' on my website.

So I am using this jQuery to load the function and apparently it doesnt load..

$(window).load(function() {
    $('.flexslider').flexslider({
        animation: "slides",
        animationLoop: false,
        itemWidth: 100,
        itemMargin: 5
    });
  });

But I get this errormessage when I am looking in the console:

Uncaught TypeError: Object [object Object] has no method 'flexslider' 

If the website could come to any help: http://nworks.nu/projects2013/sthlm/index.html

Trey answered 30/3, 2013 at 8:32 Comment(2)
check whether you include flexslider js sourceGunplay
<script src="library/js/jquery.flexslider-min.js"></script> - I do right? :)Trey
M
4

Mainly two reasons for this error.

  1. Either you have not included the required plugin.
  2. You have included jQuery twice.

You are doing the second thing i.e. including jQuery twice.

jQuery 1.6.2 at the top (before flexslider js) and jQuery 1.9.1 at the bottom (right before </body>)

Please correct that and the error would be gone.

p.s. Use $(document).ready() in place of $(window).load() and do not use frames

Mangan answered 30/3, 2013 at 8:40 Comment(4)
Where am I doing that? I can only see one thereTrey
Uncaught ReferenceError: jQuery is not defined jquery.flexslider-min.js:43 Uncaught ReferenceError: $ is not defined index.html:16 Uncaught ReferenceError: $ is not defined - That's whats coming now :/Trey
Include jQuery before using $. Either include the jQuery at top or write your flexslider code at bottom,after jQueryMangan
Boom! You rescued my morning! Thanks alot dudeTrey
B
0

I had this same problem on a site I am editing, but oddly enough only one version of jQuery was being called, but so was:

jQuery.noConflict();

Be sure that is not happening to you.

Braunite answered 9/7, 2013 at 0:2 Comment(0)
T
0

I had this error and it was the path to the flexslider.js file being incorrect. In the console the error was followed by the get call for the flexslider.js file. Clicking this goes to the network tab, which show the get of the file had failed.

Tawnyatawsha answered 30/12, 2013 at 14:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.