嗨,我正在使用 jQuery 加载从链接中获取 ahref,然后我想从进入 div 的页面加载 div,所以尝试了这个:
// lets load the contents
$('#navigationLinks a:not(:first-child)').click(function(event){
$('#wrapper').animate({
'left':'0px'
});
var href = $('#navigationLinks a').attr('href');
$('#content').load(href + ' #resultDiv');
event.preventDefault();
});
这是 HTML:
<div id="navigationLinks">
<a href="index.html" id="dashboardHome">Dashboard Home</a>
<a href="industry-overview.html" title="Industry Overview" class="first currentLink">Industry Overview</a>
<a href="regions.html" title="Regions">Regions</a>
<a href="industries.html" title="Industries">Industries</a>
<a href="security-pipeline.html" title="Security Pipeline">Security Pipeline</a>
<a href="audit-events-issues.html" title="Audit Events & Issues">Audit Events & Issues</a>
<a href="account-filter.html" title="Account Filter">Account Filter</a>
<a href="contractual-delivered-services.html" title="Contractual vs. Delivered Services" class="last">Contractual vs. Delivered Services</a>
</div>
我尝试在 # 之前删除“#resultDiv”中的空格,但这没有帮助,任何帮助将不胜感激。