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
the sandman
1,0293 gold badges13 silver badges32 bronze badges
2 Answers 2
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
Explosion Pills
193k56 gold badges341 silver badges417 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
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
james emanon
11.9k12 gold badges70 silver badges107 bronze badges
Comments
lang-js
.yoxviewplugin is not properly loaded when you call it.$(...).yoxviewshould be defined?