View Full Version : Problems with links

05-18-2012, 07:10 PM
Hello everyone,

First off thanks for taking a moment to help me out here.

I'm currently building a webpage using html5 and javascript and i'm fairly new to this.

I'm using a "sliding website plugin" to navigate different section of my website on a single page.
The URL's are then displayed like this : "../Website/en/index.html#/home", "../Website/en/index.html#/casestudy" etc..

As you can see it's included inside an /en/ folder.
I would like people to be able to change from english to french but to stay on the same "page" (ie : en/index.html#/casestudy to fr/index.html#/casestudy)

Currently for accessing the translated page my code is :
<li><a href="../fr/index.html" title="francais">Franšais</a></li> but it will link to "../Website/fr/index.html#/home" no matter what page the user was on. I do not want them to be sent back to the home page.

Is there anyway I can achieve this with html or javascript?

05-19-2012, 09:15 AM
Can we have a link to your site.

05-19-2012, 01:15 PM
../fr/index.html is a relative url, thus it will point to a page that are located relative to the current page.

../ means go up 1 directory
fr/ means go to subfolder fr.
index.html means open index.html

The cuurent document is loated inside ../website/en/
../ leads to the parent folder
fr/ leads to subfolder fr/
index.html opens this file inside that folder.

if you then want it to lead to any hash within that page, then you must specify it in the url too.
<a href="../fr/index.html#/casestudy">

06-01-2012, 09:53 PM
Unfortunately that wouldn't work since the content of the webpage is dynamically generated and all the links are pointing to a relative path .. therefore i can't specify in my header the "#/casestudy" or anything else since I don't know where my user is.

Anyway thanks for the help! I'll just send them back to index.html :thumbsup: