Answer the question
In order to leave comments, you need to log in
How to make the same navigation block on all pages of the site?
The essence of the task: there is a navigation block, it must be the same on all pages of the site. How to make it so that when it is changed on one page, it changes on all pages at once.
Answer the question
In order to leave comments, you need to log in
PHP Include, if there is no php, then using AJAX (Be sure to include JQUERY!):
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; Charset=UTF-8">
<script type="text/javascript" src="----ПУТЬ ДО JQUERY!!!!!!!!!!!!!!!!!!!!----"></script>
</head>
<body>
<div id="menu"></div>
<script>
function show()
{
$.ajax({
url: "menu.html",
cache: false,
success: function(html){
$("#menu").html(html);
}
});
}
$(document).ready(function(){
show();
});
</script>
</body>
</html>
1. Ctrl+C -> Ctrl+V
2. SSI , this will require some kind of server with support.
3. Building a project from pieces, for example using Grunt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question