Solved

Div tag

Posted on 2006-11-08
3
174 Views
Last Modified: 2010-04-09
Hi

I have senario I need to create hiperlink on the top so that user can navigate.
my problem is if I link on the link it is opening new page...
I want help how can I write javascript in HTML so the the trageting page will be displayed below the menu....

example

link1               link 2             link3
---------------------------------------
traget page based on the link....


please suggest me some good online example site that will provide this kind of example used mostly....


thanks
0
Comment
Question by:basirana
3 Comments
 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 17904087
The best way to do this is really to just include the menu on every page.  Using a server-side scripting language like PHP or ASP, or even using Apache's "Server-Side Includes" (SSI) makes it really easy to do so.  In fact, it won't even require any Javascript.
0
 
LVL 17

Accepted Solution

by:
BogoJoker earned 500 total points
ID: 17904242
Votey has a correct answer.  It is easier on you the developer to just have 3 seperate pages, each page with the same code for that menu.  That can be done, like Votey said, with server-side scripting languages.

There is however another, more advanced alternative.  AJAX, much more difficult to code for a beginner, combines javascript and server-side scripting to actually change that "target" section without reloading the page.  I doubt that this concept is really applicable for your situation but it is an alternative that is growing in popularity.

You asked for some links to help you get start.  If you are unfamiler with PHP or ASP then you should start with the basics:
http://www.w3schools.com/ <-- This site teachs the basics in almost any web development field, HTML, PHP, ASP, AJAX

I suggest that you follow Votey's advice though and stick with the simple approach.  No need complicating something this simple.  But if you continue in web development you will see that this is a situation where AJAX could be applied.  Personally I think it is overrated =)

Joe P
0
 
LVL 6

Expert Comment

by:sodalitas
ID: 17906750
Another alternative is to have all 3 pages worth of data on the same page in <div> tags, and have the links on the top run a javascript function to only display the contents of the relevant <div> tag.  This might be applicable for static content pages.

Another alternative is to use frames, have your menu on one frame and have a frame underneath it for your content which is loaded based on the link they chose.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now