Include Common Files in HTML using JQuery

Hi,

This post is about “Include Common Files in HTML using JQuery”. Trying to explain with a simple example. JQuery load() function is used for including common HTML files in multiple pages. An example for this is added here

 

You can copy code from here http://tny.cz/99f2f30b.

If you have any query, please comment below.

Thanks.

jquery include html file in div
how to load html page in div tag using javascript
load external html into div
how to call html page in div tag
how to load html page in div tag using javascript
load content into div without reloading page
how to automatically include your header, navigation, and footer on every page
how to include header and footer in html file
how to include header and footer in html using javascript
how to include header and footer in html page using jquery
common header and footer for all html pages
how to create headers and footers in html
9 replies
  1. James Finley
    James Finley says:

    Actually, this is a bad idea. If JavaScript is disabled or fails to load, this will fail to show critical components of the page. Create a simple PHP script to do this on server.

    Reply
  2. Gopal
    Gopal says:

    I convert html page to php and include that php page by using php include method.
    So my question is that which is faster to load???

    Add by using jquery Load() function or else by using php include????

    Reply
    • Hariprasad
      Hariprasad says:

      Hello,
      Proceed with PHP include(), which is fast i guess. Haven’t done any research on it. But if you are using jQuery load(), it won’t work if jQuery isn’t loaded. This thread just explains how to include inside html file.

      Regards,
      Hari

      Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.