How to get adress bar link?

Discussion in 'JavaScript' started by Shile, Jun 16, 2007.

  1. #1
    I have 4 language web page...php with include functions.
    I want that each page can be reched in any language directly.When I am on english version just to click on italian flag and to get italian version.
    Now I can only go ?lang=ita which redirects me few pages back and I need (my visitors) to again browse to desired page.

    Is there a script that will get adress bar content and just add ?lang=ita at its end.In that way current page will just change language.Thats my goal.

    TNX for answers.
     
    Shile, Jun 16, 2007 IP
  2. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #2
    It should be easy to change your script so that it works like that. Change the link to add ?lang=ita at the end by removing ../, /, or whatever is in front of it. And make sure the code to act on it is invocated. An alternative is to keep the links the same and in the code used to set to language, set a redirect to the referer (the page where the user clicked the link).
     
    krt, Jun 16, 2007 IP
  3. Shile

    Shile Guest

    Messages:
    9
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Well..my visitors are in the page www.my web site.com/?part=12
    By default its in english....
    To go at italian version there must be added &lang=ita ...
    If I put to href &lang=ita they get directed to www.my web site.com/?lang=ita which is few pages back in navigation..

    I need that &lang=ita is just added to www.my web site.com/?part=12 ... so I get www.my web site.com/?part=12&lang=ita
     
    Shile, Jun 16, 2007 IP