• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

Regarding Including HTML page

Hi,

I have a  homepage.html which has a header and navigation menu.   In navigation menu i have menu items which has hyperlinks  to other html pages (page1.html, page2.html, page3.html) .In page1.html and page2.html i want to include the contents of homepage.html because it has header's description and menu description .  How do i include the contents of homepage.html in page1.html, page2.html and page3.html?

0
pigeon5566
Asked:
pigeon5566
  • 4
  • 3
  • 2
1 Solution
 
Steve BinkCommented:
If you're working in HTML, you'll need to copy the contents to each page that needs it.

If you can work in a server-side language, such as PHP, you can use the include() and require() functions.  
0
 
pigeon5566Author Commented:
Thanks for the info..    So your saying in HTML there is no tag to include the contents of other HTML Page.  So i need to use jsp for doing this?  
0
 
Steve BinkCommented:
Correct.  JSP, ASP, PHP...they can all do what you're looking for.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Michel PlungjanIT ExpertCommented:
PS: There IS a tag to include content.
It is called iframe
0
 
Steve BinkCommented:
I did not consider an iframe for this question because of the nature of the include.  I suppose it would work (no reason it shouldn't), but I would not use an iframe for the header/menu of a page...I'd use an include file.
0
 
Michel PlungjanIT ExpertCommented:
If we take the comment


"So your saying in HTML there is no tag to include the contents of other HTML Page."

The answer could be iframe :)
0
 
Steve BinkCommented:
You are correct...I misspoke because a) I was focused on the context of the request, and b) I don't generally consider iframe to be a solution.  (my own personal bias against frames and their kin)

The <iframe> tag would be able to do the requested work.  Future readers can see more information about that concept here:

http://www.w3schools.com/tags/tag_iframe.asp

I recommend against using them as a general rule, and would still stand by my response here given the context of the request.
0
 
Michel PlungjanIT ExpertCommented:
Sure - I completely agree. If you have access to server side processing, iframes should be avoided.
That said, I am considering using them myself on my own site to be able to control bulk download - e.g. if you are not human, you do not get the iframe with the content
0
 
pigeon5566Author Commented:
Apologies for the delay
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now