Solved

Div tag

Posted on 2006-11-08
3
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

729 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