I am trying to build a calendar using this tutorial which uses backbone and the jquery FullCalendar plugin. I want to attach a click event handler to a cell(weekday view) of the calendar-this is the code I tried for testing:
$(document).ready(function()
{
$('.fc-event-time').click(function()
{
alert('test');
});
});
The above does not work.fc-event-time is the class associated with the cell that contains the time.Here is an image of the cell with some notes in it. image
The whole calendar is created with JS.The only HTML required is a div named calendar.Can that be the reason why the event handler cannot be attached. Look at some code to see what I am talking about:
<script type='text/javascript' src='js/fcalendar/fullcalendar.js'></script>
<script type="text/javascript" src="js/underscore.js"></script>
<script type="text/javascript" src="js/backbone.js"></script>
<script type="text/javascript" src="js/fcalendar/apllication.js"></script>
<script type="text/javascript" src="js/fcalendar/custom_cal_code.js"></script>
<div id='calendar'></div>
fullcalendar.js is the file the created the calendar inside div#calendar.Application.js is the backbone code(REST,render functions,models etc) which adds some functionality to the calendar and custom_cal_code.js is my code you see above-which tries to attach the event handler.Jquery dependencies are not shown above for the sake of brevity.