0
我有我的內index.html
文件導航欄和我加載它在我的homePage.html
文件中如下:如何使用jQuery創建一致的導航欄?
<!DOCTYPE html>
<html>
<head>
<script>
window.$ = window.jQuery = require("jquery")
</script>
</head>
<body>
<div id="navbar">
</div>
<div id="page-wrapper">
</div>
</body>
<script>
$(function(){
$("#navbar").load("./navbar/index.html");
});
</script>
</html>
當我把裏面的page-wrapper
隨機數據因爲通過導航欄所掩蓋。
我之前和Meteor
一起工作過,之前我們有一個叫{{yield}}
的東西,我們用它來指示其餘的內容應該放在這裏。
它是如何在jQuery中完成的?