In PHP, we will do something like this:
index.php
<?php
include 'inc/head.inc.php';
include 'inc/header.inc.php';
?>
<div id="uniqueDIV">
//Your unique page-specific divs can go here
</div>
<?php include 'inc/footer.inc.php'; ?>
So, in your file head.inc.phpyou have only a regular DOCTYPE file and <head>your file.
Ruby :
load "inc/head_inc.rb"
require_relative "inc/head_inc.rb"
https://practicingruby.com/articles/ways-to-load-code
- js/jQuery . PHP, . , PHP, js/jQ , ( ) .
:
HTML
<div id="navbarDIV"></div>
JS/JQuery:
<script type="text/javascript">
$(function(){
$('#navbarDIV').load( 'inc/navbar.inc.html' );
});
</script>
, jQuery. , <head>:
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
jsFiddle demo
: script <head> , html. . <head> ( ) .
: ".inc". , . head.html head.php ..