Add html to html

Asked 2 years ago, Updated 2 years ago, 32 views

Hi, how are you?

I'd like to put the html file I made in the html file to take the layout structure as it is

I googled it and it's <? It says to include "include.html"?> but there is no response.

If you know, please answer!!

Oh, and if you include it in JSP, it comes out well in the local area, but if you just upload it on the server,

<%@ page language="java" contentType="text/html; charset=UTF-8" 
        pageEncoding="UTF-8"%> 
<%@include file="myNav.html" %> 
<%@include file="myNav1.html" %>

This is the only phrase that comes out. Of course, the server has all the files you want to include.

Please do this too. Thank you. Have a nice day

html include

2022-09-21 20:23

2 Answers

jquery would be the most convenient to include html in html.

<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script type="text/javascript">
      $(document).ready(function(){
         $("#header").load("header.html")
        /* It is also possible through ID designation. 
         $("#header").load("header.html #navbar")
         */       
      });
</script>    
<body>
    <div id="header"></div>
</body>

header.html

    <div id="navbar">
        <ul class="nav">
             <li><a href="#">munu1</a></li>
             <li><a href="#">menu2</a></li>
             <li><a href="#">menu3</a></li>
         </ul>
    </div>


2022-09-21 20:23

<? Syntax is php and

Please include jsp instead of html in jsp.

<%@ include file="/header.jsp" %>

It's usually done like this.

What do you mean by this phrase when you post it on the server?

You have to write a phrase that corresponds to this phrase...

And of course you posted it on WAS like Tomcat, right?


2022-09-21 20:23

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.