0

I've been searching in google how to include any html file inside my <head> in another html page, but all I got was with PHP and I don't want to use PHP, I'd like to use HTML and the last case a JavaScript code.

My page.html:

<!DOCTYPE html>
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en" xmlns="http://www.w3.org/1999/xhtml" > <!--<![endif]-->

    <head>


    </head>

</html>

My header.html:

<!DOCTYPE html>
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en" 
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui"> <!--<![endif]-->


        <!-- Basic Page Needs
      ================================================== -->
        <meta charset="utf-8" />
        <title>Lucas - Web Developer</title>
        <meta name="description" content="" />
        <meta name="author" content="" />

        <!-- CSS
      ================================================== -->
        <link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
        <link href="http://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700|Roboto+Slab:300,400" rel="stylesheet" type="text/css" />


        <!-- JS
      ================================================== -->
       <script type="text/javascript" src="js/jquery.min.js"></script>
        <!--[if lt IE 9]>
        <script src="js/modernizr.custom.11889.js" type="text/javascript"></script>
        <![endif]-->
            <!-- HTML5 Shiv events (end)-->
            <script src="js/mgmenu_plugins.js"></script>
        <script src="js/mgmenu.min.js"></script>


        <!-- Favicons
      ================================================== -->
        <link rel="shortcut icon" href="images/favicon.ico" />

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


</html>

The question is: how do I include header.html inside the <head> of page.html? I've tried the ui:include/ui:insert but didn't work well (maybe it's me that is using wrong)

Thank you! :)

Lucas
  • 129
  • 9
  • Appears to be duplicate of `http://stackoverflow.com/questions/8988855/include-another-html-file-in-a-html-file`. – dcromley Apr 27 '14 at 15:47
  • Ok. But, header.html must have DOCTYPE, html and head tag as well or it's not necessary? – Lucas Apr 27 '14 at 16:27
  • Also, i get this error in console: Uncaught ReferenceError: $ is not defined – Lucas Apr 27 '14 at 16:29

0 Answers0