Solved

Div tag

Posted on 2006-11-08
3
164 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

747 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

17 Experts available now in Live!

Get 1:1 Help Now