I'm using jquery load function to scroll between pages of a calender in my page. I'm using this function
$(document).ready(function(){
$('a.cal').bind('click', function(e) {
var url = $(this).attr('href');
$('div#calender').load(url);
e.preventDefault();
});
});
to assign the behavior to anchors with the class "cal" which basically load the next and previous page of the calender into the calender's container, #calender.
Problem is the behavior works only ONCE. The div refreshes with the new content nicely the first time, but subsequent clicks of the next/prev buttons have it load a new page.
Can anyone help me out please?
My guess is that the above code assigns the behavior to the anchors with class 'cal' on the first load, but clicking on the next/prev button refreshes the calender in the div, and those nav buttons do not have the ajax behavior.
How can I fix this though... I would really appreciate your kind help.
Thanks.