Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-02-2004, 05:47 PM   PM User | #1
mbl
New Coder

 
Join Date: Sep 2004
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
mbl is an unknown quantity at this point
HOW-TO common parts of an HTML page

Good friends,

This is a question on fundamentals, not on details yet.

The HTML pages in question are typical and simple in that they would consist, each, of:

---------------------------------------------------
Top-Part (Code is same for all),

Middle-Part (Code is DIFFERENT for each page), and

Bottom-Part (Code is same for all).
----------------------------------------------------

Is there a way (or more than one) to have only ONE Top-Part and only ONE Bottom-Part that is called by the page-in-question which would basically consist of the Middle-Part and calls to the Top and bottom parts?

This means that a change in the Top-Part or in the Bottom-Part would reflect in as many HTML pages as used them right away, with no need to go and change any of the pages that call them.

Thanks a lot.

-mbl-
mbl is offline   Reply With Quote
Old 11-02-2004, 05:54 PM   PM User | #2
fci
Senior Coder

 
Join Date: Aug 2004
Location: Twin Cities
Posts: 1,345
Thanks: 0
Thanked 0 Times in 0 Posts
fci is an unknown quantity at this point
use a server-side language such as PHP.
Code:
<!-- top content / body tag/ etc -->
<?php switch / if / whatever which will lead to variable content ?>
<!-- bottom content / footer-->
fci is offline   Reply With Quote
Old 11-02-2004, 08:41 PM   PM User | #3
mbl
New Coder

 
Join Date: Sep 2004
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
mbl is an unknown quantity at this point
Quote:
Originally Posted by fci
use a server-side language such as PHP.
Code:
<!-- top content / body tag/ etc -->
<?php switch / if / whatever which will lead to variable content ?>
<!-- bottom content / footer-->
Thanks, FCI.

Am not at that level, though, unfortunately.

Any other way? How about Frames (which still would need to study, and plan-to). Could frames load themselves with fixed data?

Or something like layers (like photo-shop, concept only)?

Thanks.

-mbl-
mbl is offline   Reply With Quote
Old 11-02-2004, 09:03 PM   PM User | #4
Willy Duitt
Banned

 
Join Date: Sep 2003
Posts: 3,620
Thanks: 0
Thanked 0 Times in 0 Posts
Willy Duitt is an unknown quantity at this point
This is not a javascript question and should be moved to the CSS/HTML forum... Please do not cross-post but rather contact a moderator and request that your post be moved to the correct forum....

.....Willy
Willy Duitt is offline   Reply With Quote
Old 11-02-2004, 09:13 PM   PM User | #5
Roy Sinclair
Senior Coder

 
Join Date: Jun 2002
Location: Wichita
Posts: 3,880
Thanks: 0
Thanked 0 Times in 0 Posts
Roy Sinclair will become famous soon enough
Use Server Side Includes (SSIs), contact your service provider to find the specifics for using SSIs (usually naming the pages *.shtml or similar).

See: http://www.netmechanic.com/news/vol2/server_no8.htm
__________________
Check out the Forum Search. It's the short path to getting great results from this forum.
Roy Sinclair is offline   Reply With Quote
Old 11-02-2004, 09:40 PM   PM User | #6
mbl
New Coder

 
Join Date: Sep 2004
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
mbl is an unknown quantity at this point
Quote:
Originally Posted by Willy Duitt
This is not a javascript question and should be moved to the CSS/HTML forum... Please do not cross-post but rather contact a moderator and request that your post be moved to the correct forum....

.....Willy
Sorry, Willy.

Being an ignorant, how can one know that there is or not a Javascript answer?

Thanks.

-mbl-
mbl is offline   Reply With Quote
Old 11-02-2004, 10:20 PM   PM User | #7
fci
Senior Coder

 
Join Date: Aug 2004
Location: Twin Cities
Posts: 1,345
Thanks: 0
Thanked 0 Times in 0 Posts
fci is an unknown quantity at this point
Quote:
Originally Posted by mbl
Sorry, Willy.

Being an ignorant, how can one know that there is or not a Javascript answer?

Thanks.

-mbl-
I'd say this is a PHP queston. If you don't have access to PHP .. there is a way to do it in JS but I wouldn't recommend it.
fci is offline   Reply With Quote
Old 11-03-2004, 12:48 AM   PM User | #8
joh6nn
wei wu wei


 
joh6nn's Avatar
 
Join Date: Jun 2002
Location: 72° W. 48' 57" , 41° N. 32' 04"
Posts: 1,887
Thanks: 0
Thanked 1 Time in 1 Post
joh6nn is an unknown quantity at this point
Quote:
Originally Posted by fci
I'd say this is a PHP queston. If you don't have access to PHP .. there is a way to do it in JS but I wouldn't recommend it.
agreed; this is doable with javascript, but that should be a last resort; javscript wasn't intended for this use, and won't work nearly as well as a server side language. if you absolutely can't use a server side language, or can come up with a compelling reason why you need to do this with javascript, we'll help you do it, but otherwise, i'd like to move this to the Server Side forum.
__________________
bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

i am a loser geek, crazy with an evil streak,
yes i do believe there is a violent thing inside of me.
joh6nn is offline   Reply With Quote
Old 11-03-2004, 12:57 AM   PM User | #9
AaronW
Senior Coder

 
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 1,223
Thanks: 0
Thanked 0 Times in 0 Posts
AaronW is an unknown quantity at this point
A better method would be to have the top and bottom page call the middle pages That way when you want to change your top and bottom more drastically, you won't have to touch every other page.
__________________
offtone.com | offtonedesign.com
AaronW is offline   Reply With Quote
Old 11-03-2004, 07:35 PM   PM User | #10
mbl
New Coder

 
Join Date: Sep 2004
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
mbl is an unknown quantity at this point
Quote:
Originally Posted by joh6nn
agreed; this is doable with javascript, but that should be a last resort; javscript wasn't intended for this use, and won't work nearly as well as a server side language. if you absolutely can't use a server side language, or can come up with a compelling reason why you need to do this with javascript, we'll help you do it, but otherwise, i'd like to move this to the Server Side forum.
Good friends,

As said, it was not a question about details. Only a direction was being requested. It is irrelevant if moved, therefore, to where it may belong better.

The direction is given, understood as very good, and appreciated as such.

Thanks, every one.

-mbl-
mbl is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:25 AM.


Advertisement
Log in to turn off these ads.