Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to load header and footer using Javascript

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.54k
    Comment on it

    Hello Reader's. If you have developed the header and footer of the website separatly then it's very easy to make them render on a webpage. By using the JS you can call them with a single line of code as written below:-

    <script src="//"></script>
      $("#header").load("header.php"); //set the path to your header file
      $("#footer").load("footer.php");  // set the path to your footer file
    <div id="header"></div>
    <div id="footer"></div>

    You just have to call the jquery code and give paths to you header and footer files. Div with the 'header' will include the data of header and same as footer also.

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: