views:

45

answers:

1

I'm a bit of a newbie, so excuse me if this script is rudimentary.

I'm trying to use jQuery's .load() function to load the next or previous month of an event calendar on an expressionengine site that I have built. The following script works in Chrome, Safari, IE, and Firefox 4 beta, but it fails in FF 3.6.10:

   $('th a.right, th a.left, th a.center').click(function() {
      var navMonth = $(this).attr("title");
      $('#calendar').html('<p style="padding: 102px 120px;"><img src="http://dashboardco-op.org/images/infra/ajax-loader.gif" /></p>');
      $('#calendar').load(navMonth);

});

And here's the html:

              <th colspan="1"><a id="mc_prev_month" class="icon left" title="{path='live/calendar'}{prev_month format="%Y/%m"}/">&larr;</a></th>
              <th colspan="5"><a class="center" title="{path='live/calendar'}{next_month format="%Y/%m"}/">{month format="%F %Y"}</a></th>
              <th colspan="1"><a id="mc_next_month" class="icon right" title="{path='live/calendar'}{next_month format="%Y/%m"}/">&rarr;</a></th>

I'm using the 'title' attribute, because .load() doesn't overwrite the 'href'-- therefore the pages load in a new page rather than asynchronously.

Thanks.