-2

I have 3 different languages in my website. I would like to create 3 buttons for changing relative language:

  • Clicking Eng will direct to /en/index.html
  • Clicking Chinese will direct to /../chi/index.html
  • Clicking japan will direct to /../jp/index.html
<a class="changeLang" href="chi">CHI</a>
<a class="changeLang" href="eng">ENG</a>
<a class="changeLang" href="jp">JP</a>

Is it any simple javascript to change the page? Thanks a lot.

Nikos M.
  • 8,033
  • 4
  • 36
  • 43

1 Answers1

0

You can't get informations from your previous Javascript page.. When you reload it, your variables are deleted.

If you want to get information and use it between pages, you can use $_SESSION or $_COOKIE from PHP.

Take a look here.

Good luck !

Community
  • 1
  • 1
Leogout
  • 1,187
  • 1
  • 13
  • 32
  • as far as i understand the locale pages should be relative to current page (so user can be taken from a page to the exact same page but in different locale) – Nikos M. Apr 24 '15 at 17:23