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

enter image description here

custom_body_page.html

enter image description here

custom_footer_page.html

enter image description here


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

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -