Question : Swap text on web page without reload (Javascript)

Hello,

2-part question (both parts rudimentary, I think, for someone with Javascript knowledge):

1. On the site www.motor-pro.com every page has Russian and English text. I would like to add a button that lets the user switch (I do not want to do auto-detect) -- but without making a separate page (i.e. no re-load). Can I have javascript switch the contents of something like a <div>, with one option being a default?

2. Whatever language is selected on a page should be the language that all other pages on the site open to by default. So if the user is looking at "links", switches to English, then clicks on About Us, it should open in English (even if Russian is the normal default).

Could this be done? If so, I would be very grateful for any help toward achieving it. My knowledge of HTML/CSS is fairly basic, and Javascript is virtually non-existent, so please -- be gentle!

Thanks a ton,

Andrey

Answer : Swap text on web page without reload (Javascript)

Attached is a zip file with all the code you need for the first page.  You will have to change some image links to get it to work again.  There is javascript to load the text in the center section and each text has a button to change to the other language.  When it changes, it also sets a cookie to tell which language is supposed to be used.  You will have to include that code and the <div id="langclue" style="visibility: hidden;"></div><div id="langtext"></div> on every page you want to have these functions on.
Random Solutions  
 
programming4us programming4us