0
我試圖使用jQuery在單擊導航鏈接時改變我的主頁的主要內容區域。我使用.load()來做到這一點,但我引用的外部html頁面不會加載(沒有任何反應)。jQuery將不會加載外部HTML模板()
custom.js
$(document).ready(function(){
$("#about").click(function(event){
event.preventDefault();
$(".main-content").fadeToggle("slow", function(){
$(this).load("about-us.html")
});
});
});
的index.html
<div class="inner cover main-content">
<h1 class="cover-heading">A heading</h1>
<p class="lead">This is the best page of all time.</p>
</div>
爲什麼不接受你自己的答案。大聲笑 – Velocibadgery
@Aaron它不會讓我48小時。不幸的是,我也無法提出自己的答案;) – msarlo