I'm trying to pass a function from .click() function but for some reason I'm not getting the value. Here is my code,
<script>
var guyid;
$(document).ready(function() {
$('.guyid').click(function () {
guyid = $(this).attr('id'); //This variable needs to pass
alert(guyid);
});
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicDay'
},
editable: true,
eventLimit: true, // allow "more" link when too many events
eventSources: ['json-script.php?id=' + guyid] //I need it here
});
});
</script>
How can I pass the variable from .click() function to the eventSources? Need this help badly. Tnx.
fullCalendaragain with the changed property. That requires that plugin to support changing options after setup (most good plugins do).