the sandman
the sandman

Reputation: 1029

jQuery Error: xxx is Not a Function

This has been driving me crazy. I keep receiving "TypeError: $(".yoxview").yoxview is not a function".

Any clue what is wrong with my formatting or logic?

<script type="text/javascript">
        $(document).ready(function () {
            $('.yoxview').yoxview({
                skin: "top_menu",
                dataUrl: "http://www.youtube.com/results?search_query=decemberists&aq=f",
                thumbnailsOptions: {
                    setTitles: true,
                    thumbnailsClass: "thumbnail"
                }
            });
        });
    </script>

Upvotes: 0

Views: 778

Answers (2)

Explosion Pills
Explosion Pills

Reputation: 191729

Most likely the .yoxview plugin is not properly loaded when you call it.

Make sure that you are including the appropriate script before you attempt to call it, for example:

<script src="yoxview.js"></script>
<script>
   $("#elem").yoxview();
</script>

Upvotes: 1

james emanon
james emanon

Reputation: 11807

Are you using any other libraries in your code, ie. Prototype? If so, the "$" will clash. do.

   jQuery(document).ready(function ($) {
        $('.yoxview').yoxview({
            skin: "top_menu",
            dataUrl: "http://www.youtube.com/results?search_query=decemberists&aq=f",
            thumbnailsOptions: {
                setTitles: true,
                thumbnailsClass: "thumbnail"
            }
        });
    });

Also, instead of using '.yoxview' trying assigning an ID to that same element and using:

$('#yournewID').yoxview

Upvotes: 0

Related Questions