Lets say I have a web site with 50 web pages. Each page consists of

  • A Header
  • Navigation
  • Left-side content
  • Right-side content
  • Footer

Without using:

  • Frames
  • Server-side programming
  • Third-party tools and software
  • Frameworks

I would need to put the code (HTML Markup) for each of these 5 sections in each of those 50 pages? What happened to the term "Code Once, Use Again & Again"? Also If I want to change anything, I would need to change it at 50 places. This is just reduntant. Can I use as such:

<object type="text/html" height="100%" width="100%" data="header.html"></object>
  • Sorry about the code. Can not get the Code in the editior to work properly about 8 years ago

4 answers

This was chosen as the best answer

My first reaction is to say server side programming, like PHP. For whatever reason, you don't want to do that, so I would say you have a couple of options (maybe more, but these are what come to my mind):

  1. Dreamweaver, or some other IDE that would handle templates and keep those repetitive parts up to date without you having to deal with them. It is not the same as using something akin to frames, but it would be a similar amount of work for you. ... As I finish typing this, I realize it breaks the third-party software stipulation. Still, it might be an option.
  2. Server Side Includes (also known as SSI). It is not a frame, programming (at least, not if you don't want to), framework, or third party tool. Find a tutorial online to learn how to use them, but it should be pretty much exactly what you are looking for. Apache and Wikipedia have more info.
Answered about 8 years ago by Abinadi Ayerdis
  • Thanks Abinadi. I will look up SSI. about 8 years ago

You don't do it without Server Side programming. It's an odd question, since SSI's and other preprocessors have been around for nearly as long as HTML, why would you not want to use them?

Answered about 8 years ago by Tony Crockford

Thanks Tony. I am new to web development and have taken the path HTML/XHTML, CSS, XML, Javascript, AJAX, PHP and SQL in my learning cycle. So I have not reached Server Side Programming.

Answered about 8 years ago by
  • Sorry used the Answer instead of the comment about 8 years ago
  • What stage are you at in this learning cycle? Abinadi Ayerdis about 8 years ago
  • Abinadi. I have finshed HTML/XHTML to the level where I am able to right polyglot syntax, Half way through with HTML5, a pro (or at least I am pretty good) with CSS2.1 and CSS3, Just starting XML (making my own DTD's), and that's about it. Have not touched server side such as PHP, SSI or SQL (although I am quite good with Database modeling such as ERD's and UML). Server side I have not touched till now because whenever I try to do so, the tutorial or book says that you must first learn HTML, CSS and Javascript. Have stayed clear of frameworks but plan to undertake JQuery once I reach medium level with Javascript. So I guess, my questions above is related to server side, I however did not know. about 8 years ago

You can do it with JavaScript, using AJAX leveraging jQuery, but that would possibly take as much to figure out for you as learning some server side code. www.asp.net has all the information you need to build this, all tools are free from Microsoft, it has excellent learning and support resources, and thus it's the best platform for web development IMHO (unless you only own a MAC). I would suggest that you learn take the time to learn MVC, but if you are starting out a regular web forms app will do, just steer clear of web controls, do everything by hand. That will make the transition to MVC that much easier, and increase your CSS/HTML and server side code knowledge. Pro ASP.NET MVC 2 Framework is an excellent book to read if you want to get started.

Answered about 8 years ago by lecynkar