I currently have a button for each language to allow users to view website in difference languages
<a target='_blank' href="http://www.jthink.net/songkong/en" title='English'><img src="http://static.albunack.net/images/flags/flags-iso/shiny/32/GB.png" alt="English" height="32" width="32" valign="top"></a>
<a target='_blank' href="http://www.jthink.net/songkong/de" title='Deutsch'><img src="http://static.albunack.net/images/flags/flags-iso/shiny/32/DE.png" alt="Deutsch" height="32" width="32" valign="top"></a>
<a target='_blank' href="http://www.jthink.net/songkong/es" title='Español'><img src="http://static.albunack.net/images/flags/flags-iso/shiny/32/ES.png" alt="Español" height="32" width="32" valign="top"></a>
<a target='_blank' href="http://www.jthink.net/songkong/fr" title='Français'><img src="http://static.albunack.net/images/flags/flags-iso/shiny/32/FR.png" alt="Français" height="32" width="32" valign="top"></a>
I now want to use a drop down to save space
<select>
<option value="en">English</option>
<option value="de">Deutsch</option>
<option value="es">Español</option>
<option value="fr">Français</option>
</select>
but how do I make a selection trigger the correct page to be loaded
As simple as this:
<select onchange="location.target='_blank' href='http://www.jthink.net/songkong/'+this.value;">
<option value="en">English</option>
<option value="de">Deutsch</option>
<option value="es">Español</option>
<option value="fr">Français</option>
</select>
Let me know if it doesn't work.
You can try unobtrusive way too:
<select id="langchange">
<option value="en">English</option>
<option value="de">Deutsch</option>
<option value="es">Español</option>
<option value="fr">Français</option>
</select>
document.querySelector('#langchange').addEventListener('change', function () {
location.href = "http://www.jthink.net/songkong/" + this.value;
});
use this onchange attribute in your select:
<select onchange="window.location = this.options[this.selectedIndex].value;">
and set the value of each option to the appropriate url
I have 4 check boxes, and depending on which one/pair is selected I want a specific array to be displayed on the page. I'm relatively new to angularjs so I'm not sure how to get this to work. So how ...
I have 4 check boxes, and depending on which one/pair is selected I want a specific array to be displayed on the page. I'm relatively new to angularjs so I'm not sure how to get this to work. So how ...
I have a small and quite standard application that: Fetches objects from the server Renders the objects and allows some editing on them. If it is important, this editing only affects DS.hasMany ...
I have a small and quite standard application that: Fetches objects from the server Renders the objects and allows some editing on them. If it is important, this editing only affects DS.hasMany ...
I'm looking for a list of time zones that corresponds to major cities. Like what java.util.TimeZone can provide. I mean, I want to resolve the America/Los_Angeles identifier to UTC-8:00 in javascript. ...
I'm looking for a list of time zones that corresponds to major cities. Like what java.util.TimeZone can provide. I mean, I want to resolve the America/Los_Angeles identifier to UTC-8:00 in javascript. ...
Please look at below codes: Case 1: var a = { b: function(){ console.log(a) }, c:1 }; Case 2: var a = { b:a, c:1 }; Now when I write this : a.b() // for first console....
Please look at below codes: Case 1: var a = { b: function(){ console.log(a) }, c:1 }; Case 2: var a = { b:a, c:1 }; Now when I write this : a.b() // for first console....