【发布时间】:2010-10-09 03:20:04
【问题描述】:
我是一个新手,如果这个脚本是初级的,请见谅。
我正在尝试使用 jQuery 的 .load() 函数在我构建的表达式引擎网站上加载下个月或上个月的活动日历。以下脚本在 Chrome、Safari、IE 和 Firefox 4 beta 中有效,但在 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);
});
这是html:
<th colspan="1"><a id="mc_prev_month" class="icon left" title="{path='live/calendar'}{prev_month format="%Y/%m"}/">←</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"}/">→</a></th>
我使用的是 'title' 属性,因为 .load() 不会覆盖 'href' - 因此页面会在新页面中加载而不是异步加载。
谢谢。
【问题讨论】:
-
您是否尝试过使用 Firebug 并检查网络面板?
-
失败是什么意思?什么都不做?它会抛出什么错误?
标签: jquery ajax firefox expressionengine