javascript - Create full HTML file using partial HTML -
i have main html page (index.html) , need construct page page dynamically combining several html files (custom_header_page.html/ custom_content_page.html/ custom_footer_page.html)
.
i looking way done without server side scripting invloving.
eg:
custom_header_page.html
custom_body_page.html
custom_footer_page.html
just tired following in index.html file , yes loads want override <head> </head>
content of index.html have added in "custom_header.html" file.
index.html
<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" type="text/javascript"> </script> <title>title</title> </head> <body> <div id="custom_header"></div> <div id="custom_body"></div> <div id="custom_footer"></div> <script> $(function(){ $("#custom_header").load("custom_header_page.html"); $("#custom_body").load("custom_body_page.html"); $("#custom_footer").load("custom_footer_page.html"); }); </script> </body>
you cannot edit files without using server side php, edit html headers using jquery on local browser wouldn't change else.
Comments
Post a Comment