我将如何通过同一网站上的多个网页同步文本?
How would I go about syncing text through multiple webpages on the same website?
我希望在我网站的每个具有相同文本的页面顶部都有一个文本框,但我不想为每个网页单独编辑代码。我如何将文本同步到所有网页?
使用 jQuery...
包含常用文件
<html>
<head>
<title>Title</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
</head>
<body>
<div id="header"></div>
<div id="content">
Main Content
</div>
<script>
jQuery(document).ready(function(){
jQuery("#header").load("header.html");
});
</script>
</body>
</html>
我希望在我网站的每个具有相同文本的页面顶部都有一个文本框,但我不想为每个网页单独编辑代码。我如何将文本同步到所有网页?
使用 jQuery...
包含常用文件<html>
<head>
<title>Title</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
</head>
<body>
<div id="header"></div>
<div id="content">
Main Content
</div>
<script>
jQuery(document).ready(function(){
jQuery("#header").load("header.html");
});
</script>
</body>
</html>