Full Calendar.js Cannot Initiate
Sorry but I can't seem to get my special-kid helmet off today. I'm attempting to use Full Calendar ... I've verified that there are no relevant javascript errors, all of the scripts are being called properly, I have a #calendar div, yet I'm getting no results or output on the page.
Using this within WordPress, here is my relevant header:
<link rel="stylesheet" type="text/css" href="<?php blogi开发者_如何学Cnfo('template_url')?>/fullcalendar-1.4.6/fullcalendar.css" />
<script type="text/javascript" src="<?php bloginfo('template_url')?>/fullcalendar-1.4.6/jquery/jquery.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url')?>/fullcalendar-1.4.6/fullcalendar.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// page is now ready, initialize the calendar...
$('#calendar').fullCalendar({
// put your options and callbacks here
})
});
</script>
And you can view the page itself (with non-existent calendar) here: http://ranya.net/wp/classes/
Any suggestions for debugging / troubleshooting? I have no idea what's wrong here...
EDIT: As pointed out by Charles below, it seems like the function fullCalendar is undefined. I'm just following the basic callback parameters for the script, does anyone have an idea why it would be undefined? I haven't changed anything from the default/basic callback.
Chrome's Javascript console says:
Uncaught TypeError: Object # has no method 'fullCalendar' (classes:37)
Line 37 is your $(...).fullCalendar() line.
Running just $('#calendar').fullCalendar();
at the console results in the same error.
I'm not completely sure where to troubleshoot this one from here because I don't know the plugin at all. I'd start by switching to the non-minified version of the plugin and see if that makes a difference.
Edit: FWIW, I've had the darndest time getting real errors inside $(document).ready
in Firefox. I'm not really sure what's up with that.
It turned out to be a jQuery conflict. I've got alot of scripts running on this page and there were actually two conflicts, one because of calling jQuery at the top and bottom of the document. The second was because of a Web Form from MailChimp which also calls javascript.
精彩评论