• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTML include Page

 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have some static HTML pages, how to include another static HTML page in my page. please assist

I tried
<!--#include FILE="b.html" -->
But its not working.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is nothing in HTML to allow including other resources. You'll need to use whatever server-side include mechanism your web server provides.

What are you using for a web server?
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No web servers.. Simple HTML pages (Static Pages)
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without a server, how is anyone able to view your pages?

If they are just opening them as local files in the browser, then there is no include mechanism available. (Although I guess you could fashion one out of some Ajax code, but that would be rather weird.)
 
marten kay
Ranch Hand
Posts: 178
Java jQuery Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use an iframe, for example

sample1.html could have this code


and in the same directory as the above, sample2.html could have this code



with this code, material from sample2.html is included in sample1.html
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An iframe isn't exactly the same thing. It's a fixed size and does not include the enclosed page in the parent page.

Or, is that what the OP meant by "include"?
 
marten kay
Ranch Hand
Posts: 178
Java jQuery Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
definitely, an iframe allows you to get stuff from one page into another and include material in the general sense - not in the specific sense of a server side include. As we don't really know the design requirement that is being addressed here, the iframe may be an option.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic