Link to a page depending your current address.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Carcharoth
    New Member
    • May 2010
    • 2

    Link to a page depending your current address.

    I want to make a script which will be reading the name of the file the user is viewing, then change it, and then load it again. And all these into one button

    eg. when user is pressing the "Change Language" button the "Home_en.ht ml" to become "Home_gr.ht ml"

    but i don't want to put it on the page's code I want to call it on every page i want to use it.

    Is it possible for javascript to do this?
    Last edited by Niheel; May 8 '10, 03:54 PM. Reason: Spelling, grammar
  • YarrOfDoom
    Recognized Expert Top Contributor
    • Aug 2007
    • 1243

    #2
    Should be possible, I don't know how much you know about Javascript, but these pages should get you on the way.
    W3Schools - JS Location Object
    W3Schools - JS HTML DOM Event Object

    You might want to consider doing this with a server-side script language like PHP, ASP, Python,... whichever you prefer. People without Javascript enabled will be able to use the buttons as well then.

    Comment

    Working...