0

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>
asked Dec 4, 2012 at 23:03
7
  • 6
    Most likely the .yoxview plugin is not properly loaded when you call it. Commented Dec 4, 2012 at 23:04
  • What makes you think $(...).yoxview should be defined? Commented Dec 4, 2012 at 23:05
  • Oooh... this yoxview, right? Commented Dec 4, 2012 at 23:07
  • @ExplosionPills: I didn't think of that. So it may not be my logic, it may be the fact the issue is happening prior to this being loaded and the yoxview not existing. Commented Dec 4, 2012 at 23:07
  • @JanDvorak: Correct Sir. Been trying to get it to work and have been pulling my hair out. Commented Dec 4, 2012 at 23:07

2 Answers 2

1

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>
answered Dec 5, 2012 at 0:48
Sign up to request clarification or add additional context in comments.

Comments

0

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
answered Dec 4, 2012 at 23:19

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.