Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery Browser Back Button - Keep Settings
    primarykey
    data
    text
    <p>this question is based on my previous question here at <a href="https://stackoverflow.com/questions/13007293/dropdown-box-setup">stackoverflow</a> where I wanted to change the href link depending on a language selection.</p> <p>Thanks to the help here it now does what it should. </p> <pre><code>(function ($) { $(function(){ var select = $('#language-selection'); var options = select.children('#other-languages'); select.attr('style', '-moz-user-select:none;-webkit-user-select:none;'); options.css({ display:'none' }); select.click(function() { if(options.css('display') == 'none') { /* options.css({display:'block'}); */ options.slideToggle('fast'); } else { /* options.css({display:'none'}); */ options.slideToggle('fast'); } }); }); })(jQuery); var current = "English" $("[data-lang]").on("click", function() { var lang = $(this).data("lang"); $(".clickButton").prop("href", function(i, href) { return href.replace(current, lang); }); $('#language-selection &gt; #current-language &gt; img').attr('src' , $(this).find('img').attr("src")); $('#language-selection &gt; #current-language &gt; img').attr('alt' , lang); $('#language-selection &gt; #current-language &gt; img').attr('title' , lang); $("#language-selection &gt; #current-language").contents().each(function() { if(this.nodeType == 3) this.nodeValue = this.nodeValue.replace(current, lang); }); current = lang; }); </code></pre> <p>My Question is: When following a link that got changed with the language selection and the browser back button is clicked it will of course go back to the default language setting.</p> <p>Is there an easy way to "save" the language setting so that it won't switch back to the default?</p> <p>thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload