V
V
Vladimir Dubos2015-09-26 12:37:19
HTML
Vladimir Dubos, 2015-09-26 12:37:19

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

2 answer(s)
S
Schoolboy., 2015-09-26
@vovaduba

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>

D
Denis Ineshin, 2015-09-26
@IonDen

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 question

Ask a Question

731 491 924 answers to any question