Ravindra Walde

Ravindra Walde

  • NA
  • 206
  • 3.2k

how to include html page in other html page?

Aug 11 2015 5:55 AM
Hello All,
I want to include html page in other page
foe ex. home.html and footer.html
i want to include footer.html in home.html page.
and when run home.html and (ctrl+U) view source code both page code will be
want to show.
please help me.
<head>
<link rel="import" href="Test.htm"/></head>
<body>
div id="container"></div>
<script type="text/javascript">
var link = document.querySelector('link[rel="import"]');
var template = link.import.querySelector('template');
var clone = document.importNode(template.content, true);
document.querySelector('#container').appendChild(clone);
</script>
</body>
i have tried this but not shown code in view source code. 
Thanks In adavance.
Regards,
Ravi Walde

Answers (3)