Jump to content

external html


navyfalcon
 Share

Recommended Posts

This does not work for me

I tried changing to "javascript where to"

Example:

<script="header.js"></script>

as in the w3schools "javascript where to"

it also did not work

any help would be appreciated

thank you

falcon

 

External HTML

 how to add a header to all HTML pages

1. put this in your page

<script src="https://www.w3schools.com/lib/w3.js"></script>

2. then where ever you want your html code, from the separate file,

   to be included to your page

<div w3-include-html="header.html""></div>

 

template:

	<!doctype html>
	<html>
	<head>
	<meta http-equiv="content-type...
	<meta http-equiv="content-language...
	<meta name=..
	<title>...
	<link rel="stylesheet...
	<style type="...
	</style>
	<script src="https://w3schools.com/lib/w3.js"></script>
	</head>
	<body background=...
	<dl>
	<dt><b><a name="...
	<div w3-include-html="header.html"></div>
	<script>w3.includeHTML();</script>
	</body>
	</html>
	
Edited by navyfalcon
left out some content
Link to comment
Share on other sites

This code needs to run on a web server. If you open this from your local filesystem, the request to load the content will be blocked by the browser's security features. If you are running this on a web server, make sure that the file header.html is in the same folder as the file that is including it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...