1
4

3 回答 3

3

如果您只需要将类添加到链接中,那么您可以使用:

<script type="text/javascript">
   $(document).ready(function(){
        $('.next_button').click(function(){
           $('a').addClass('YourClass');
        });
   });
</script>
于 2013-08-01T03:54:22.540 回答
2

尝试

$('.next_button').click(function(){
    var href = $(this).find('a').attr('href');

    $.ajax({
     url: href
    });
}); 
于 2013-08-01T03:59:19.867 回答
0

终于找到了解决办法。见下文:

    <script>
    $(document).ready(function(){       
    $(document).on('click','.next_button', function() {
        var href = $(this).find('a').attr('href');
        $.post(href, { }, function(data){
            $('#calendar').html(data);
        })

        return false;
    });

    $(document).on('click','.prev_button', function() {
        var href = $(this).find('a').attr('href');
        $.post(href, { }, function(data){
            $('#calendar').html(data);
        })

        return false;
    });

   });
   </script>
于 2013-08-02T06:49:40.033 回答