473,473 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can I make a link in one div open to replace another div that's a seperate file?

17 New Member
Hello :),

Basically, I am creating a website and the "frames" I've created are made from divs. I want to make my code, so that when a link in the left column is clicked, a different page, with the same format as the main div appears in it's place. I can include the code I've done (which might be me making it complicated). If you could help, that would be lovely!

Here's the code;

Expand|Select|Wrap|Line Numbers
  1.  
  2. <div id="leftcolumn">
  3.         <h2>
  4.         Links
  5.         </h2>
  6.         <p>
  7.         <ul>
  8.         <il><a onclick="display_area('home.html')">Home</a></il>
  9.         <br /><br />
  10.         <il><a onclick="display_area('XMLPage/xml.html')">XML Page</a></il>
  11.         <br /><br />
  12.         <il><a onclick="display_area('SlideShow/slideshow.html')">Slide Show</a></il>
  13.         <br /><br />
  14.         <il><a onclick="display_area('Calculator/calculator.html')">Calculator</a></il>
  15.         <br /><br />
  16.         <il><a onclick="display_area('OrderForm/order.html')">Order Form</a></il>
  17.         <br /><br />
  18.         <il><a onclick="display_area('MyReport/report.html')">My Report</a></il>
  19.         </ul>
  20.     </div>
  21.  
  22.     <div id="homearea">
  23.     <div id="homecontent">
  24.  
  25.     Displayed on initial page load.
  26.  
  27.     </div>
  28.  
  29.         <div id="home" style="display:none"><?php include("home.html"); ?></div>
  30.         <div id="xml" style="display:none"><?php include("XMLPage/xml.html"); ?></div>
  31.         <div id="slideshow" style="display:none"><?php include("SlideShow/slideshow.html"); ?></div>
  32.         <div id="calculator" style="display:none"><?php include("Calculator/calculator.html"); ?></div>
  33.         <div id="order" style="display:none"><?php include("OrderForm/order.html"); ?></div>
  34.         <div id="report" style="display:none"><?php include("MyReport/report.html"); ?></div>
  35.  
  36.     </div>
  37.  
  38.     <div id="footer">
  39.     </div>
  40.  
  41. </div>
  42. </body>
  43.  
  44.     <script type="text/javascript">
  45.     var dLast=document.getElementById('homecontent');
  46.     var dCurrent;
  47.     function display_area(s)
  48.     {
  49.     new_area=document.getElementById('s');
  50.     dLast.style.display="none";
  51.     new_area.style.display="block";
  52.     dLast=new_area;
  53.     }
  54.     </script>
  55.  
  56. </html>
  57.  
  58.  
Dec 29 '10 #1
0 1486

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: DrUg13 | last post by:
Hello, after class, I checked the website and found that most class members had put the header inside of the cpp file. I usually create a seperate file for each. Which is better?? and if you...
3
by: Paminu | last post by:
I have made a lot of helping functions that I would like to have in a seperate file. I have tried putting them in a file "functions.c". I then have the file "myprogram.c" that contains some...
1
by: Alex Smith | last post by:
Hi Friends, I want to open and read a pdf file from disk And save this content of pdf file into .txt file. In short I want to convert content of pdf into .txt formate and save this text file on...
1
by: Ryan | last post by:
can i create a link that doesnt open a browser window... a link that executes the aspx.vb code first (code that creates a file) and transfers to an opening of a dynamically created (vcs outlook)...
4
by: connoisseur.infotech | last post by:
hello we are developing one tool where we need to open and make password protected zip files. we found some solutions but they don't support password protected things. does any one knows about...
6
by: Phil Latio | last post by:
I am missing a trick here on how use variables defined in seperate file. In script 1, I have proved to myself my class is working OK because I can pass in the values and the echo statement...
5
by: anilreddy_3 | last post by:
write a program that search a file for a keyword and replace that keyword with a another word. e.g. search for 'have' and replace with 'had' and list all the changes made ....to the screen...
1
by: snitu | last post by:
Hi Plz. Help me Can we link more than one external css file in single html. If yes then how . Thanks.
5
by: Brian | last post by:
Hi I have a problem in opening url using 'file'. I searched many other discussion groups and tried suggestions, but could not resolve this problem. e.g <?php $myfile =...
5
by: Unknown | last post by:
Hi, I've got this code : cb = open("testfile", "r+") f = cb.readlines() for line in f: rx = re.match(r'^\s*(\d+).*', line) if not rx: continue else:
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.