Solved

Div tag

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

777 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