3

I am getting the following error HERE

The error reads: Uncaught TypeError: Object # has no method 'data'

I cannot figure out for the life of me where this error is originating from!

If anyone has even the slightest clue, please let me know!

Thank you,

Evan

2 Answers 2

3

It's originating from "jquery.nivo.slider.pack.js" and more precisely is complaining about element.data is not a function at line 67 (Firebug is a great tool for such debugging :-) ). I am not entirely sure, but it could be because of the following code in your html:

<script type="text/javascript">
$(window).load(function() {
    $('#slider').nivoSlider();
});
</script>

$(window).load will fire as soon as the window is loaded at which point it could be that the slider div is not present in the DOM. So, try changing this to:

<script type="text/javascript">
$(document).ready(function() {
    $('#slider').nivoSlider();
});
</script>

This will ensure that the DOM has been painted and available for the plugin to work on. Also, it looks like the plugin expects an 'element' argument, whereas you are passing none, which could be the reason for element.data to be undefined. For this you can try:

$('#slider').nivoSlider($(this));

Hope one of them works for you.

Sign up to request clarification or add additional context in comments.

3 Comments

I got it working prior to this be just starting everything over, but I will accept this answer because I'm sure it will help someone else.
Thank you :) It might help better if you point out what exactly worked for you.
I must have messed up storing files in my database, because when I went back and double checked all of the files and their directories, it was working.
3

Incase anyone is stuck with the same thing, live() is deprecated replaced with on(), you need to use a newer version of nivo or an older version of jquery, jquery-1.8.0 works.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.