HTML include statement

I'm just trying to make a simple include statement in HTML. I have no idea why it is not working. My setup of the file is basically index.php in the root, and then a file called "includes" with the file "header.html" inside. So here is my code:

<!DOCTYPE html>
<html lang="en">
<html>
<head>
 <title>Title</title>
<link type="text/css" href="style/style.css" media="screen" rel="stylesheet">
<script src="scripts/jquery.js" type="text/javascript"></script>
<script src="scripts/code.js" type="text/javascript"></script>

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body>
<div id="wrapper">

    <!--#include virtual="/includes/header.html" -->

...blah blah blah
</div>  

</body>
</html>

I checked that there is a file, so I'm not sure what else the problem might be. Thank!

+3
source share
4 answers

HTML does not have a simple inclusion mechanism (except for frames, but has side effects).

Server side Include, -. - SSI, ( .html , ).

PHP SSI ( ), , PHP (.. PHP). PHP .

+5

SSI ( )? , , - .

, PHP, PHP include:

<?php include("path/to/file"); ?>
+2

:

<?php include("/includes/header.html"); ?>

-

0

JQuery :

$ ("# CLPS"). load (" http://somesite.net/dev/clips.txt ");

inserts the contents of the "clips.txt" file into the DIV with the identifier "CLPS"

-1
source

Source: https://habr.com/ru/post/1743257/


All Articles