I have static HTML files, each looks like the following.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<style type="text/css">
p {
width: 100px;
}
</style>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$(function () {
$("#accordion").accordion();
});
</script>
</head>
<body>
<div id="accordion">
<h1>Chapter 1</h1>
<p>dul tank ksk sk skek kejk jk sk sksjk sdsfkdsfs ai nvnei kdsfue v sjksfspas ksdsjkfs fsakd;afksajf;akd fa</p>
<h1>Chapter 2</h1>
<p>dul tank ksk sk skek kejk jk sk sksjk sdsfkdsfs ai nvnei kdsfue v sjksfspas ksdsjkfs fsakd;afksajf;akd fa</p>
</div>
</body>
</html>
Because
<meta charset="utf-8" />
<style type="text/css">
p {
width: 100px;
}
</style>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$(function () {
$("#accordion").accordion();
});
</script>
is the common code, I want to extract it and put into a new file named common.html.
Question
I try load common.html with link tag but it produces a strange output.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<link rel="import" href="common.html"/>
</head>
<body>
<div id="accordion">
<h1>Chapter 1</h1>
<p>dul tank ksk sk skek kejk jk sk sksjk sdsfkdsfs ai nvnei kdsfue v sjksfspas ksdsjkfs fsakd;afksajf;akd fa</p>
<h1>Chapter 2</h1>
<p>dul tank ksk sk skek kejk jk sk sksjk sdsfkdsfs ai nvnei kdsfue v sjksfspas ksdsjkfs fsakd;afksajf;akd fa</p>
</div>
</body>
</html>
What is the proper way to load?