PDA

View Full Version : linking help



physix
10-25-2007, 05:09 AM
Ok i really dont know how to say this so i made a pic in photoshop

http://img519.imageshack.us/img519/6939/imgfj5.th.png (http://img519.imageshack.us/my.php?image=imgfj5.png)
What i need is the links on the left to stay there the whole time and load the linked pages in the content area.


Thanks for any help.

PS i think this is done in js but im not for sure.

djr33
10-25-2007, 05:23 AM
1. Duplicate the links in every page. (Too much work; too hard to keep consistent, or to update)

2. Use frames. (Just a bad idea, for a few reasons.)

3. Use a server side language to include the menu on each page, such as PHP. Using include(), this is not difficult. Or, you could use SSI (server side includes), which are a bit simpler in use and don't require php, simply that SSI is enabled on your server. This is the best solution.

4. You could use an external .js file to write those links into the html, but this isn't the best option as a user without Javascript would have no access.

5. You could try a dynamic (ajax, probably) layout, where the links don't load a new page, but content into the existing page. The Ajax Tabs script in the dd library is like this.


There have been MANY topics on this subject, so search through some old threads for lots of answers.

Trinithis
10-25-2007, 06:44 AM
but this isn't the best option as a user without Javascript would have no access.
Wouldn't AJAX have these same issues? After all, it is Javascript if I am not mistaken.

Raj
10-25-2007, 07:50 AM
There are lots of options as mentioned by Daniel. Depending on you usability you can choose any.

The simplest method would be Frames, here you wouldn't have to use any scripting. Simple targetting of frames would work.

2nd, I would go for Ajax. As mentioned by Daniel, there are lots of scripts available, you can try them.

molendijk
10-25-2007, 08:47 AM
There are lots of options as mentioned by Daniel. Depending on you usability you can choose any.

The simplest method would be Frames, here you wouldn't have to use any scripting. Simple targetting of frames would work.

2nd, I would go for Ajax. As mentioned by Daniel, there are lots of scripts available, you can try them.

Yes, the simplest method would be frames. Here (http://www.dynamicdrive.com/forums/showthread.php?t=25009&highlight=molendijk) is a frameset technique that doesn't have (all) the disadvantages of frames.

Arie Molendijk.

djr33
10-25-2007, 09:34 AM
Correct, Trinithis. However, the difference with Ajax is that it usually has a non Javascript fallback (<a href="page.htm" onclick="ajax(this.href); return false;">), and using javascript to actually set the links into each page would have NOTHING there if javascript wasn't enabled, without any possible fallback (since the idea is having them updated through the single external .js file).
Important to note: be sure to have a fallback if you do use Ajax.

physix
10-25-2007, 03:57 PM
thank you for you help

Twey
10-25-2007, 04:04 PM
the difference with Ajax is that it usually has a non Javascript fallback (<a href="page.htm" onclick="ajax(this.href); return false;">)s/usually has/should have/ :(

Also, it's not really AJAX in the way that you're describing it, since it (probably) wouldn't need to use XML.