Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Div tag

Posted on 2006-11-08
3
Medium Priority
?
211 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

609 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