View Full Version : Javascript for selective Includes? (for multiple department issue)

01-09-2006, 11:48 PM
I've had an idea on implementing what I posted in


I prefer the client side approach over PHP etc server side approach. The idea is to use Includes. My current site is implemented by using Includes (every page) for page borders. The <body> of each page basically is a table.

<td colspan=3> Include top border page </td>
<td > Include left border page </td>
<td > body HTML code </td>
<td > Include right border page </td>
<td colspan=3> Include bottom border page </td>

With using cookie to remember which department I am at now, I can selectively include different/corresponding top, left, right and bottom borders. If I make the "body HTML code" also an Include, then I can load different body code for different department as well.

Now what I need is if someone could shed some light on how the Javascript can be implemented to selectively Include different pages. I guess I know where to find out how to implement cookie part.

Any suggestions or scripts will be appreciated. Thanks.


01-10-2006, 01:01 PM
This structure of page made by modules usually, for example, in CMS Mambo, phpNuke, etc. . Transition between pages with saving of modules already implemented with it. Manually it may be saved in cookie or in parameter of URL (simply). In your shop you use cookie in any case, but you may select any way.

For example,

<a href=mainScript.php?select=leftSide>Select left border page</a> in page.Script will send new page with fixed content of left border.