javascript - Can we carry selection from one page to another using jquery -


i making simple web application in html. need is, have themes option. have written following code working fine. problem is, when user selects theme , goes page using link in page, theme not carried other pages in application.

is there way in jquery, when user selects option in page selection can carried next page theme may take effect in other pages also.

here have. (this written in .dwt file pages can use this.)

<link rel="stylesheet" type="text/css" title="theme" href="css/styles_brown.css" />  <script>  $(function() {     $('#themes').change( function() {             var rel = $('link[title="theme"]');             switch($(this).val())             {                   case "brown":                      {                     rel.attr('href', 'css/styles_brown.css');                       break;                 }                  case "blue":                   {                     rel.attr('href', 'css/styles_blue.css');                       break;                 }                 case "green":                   {                     rel.attr('href', 'css/styles_green.css');                       break;                 }                 //etc             }         }); }); </script>   <select id="themes" class="txtborder txtddpad">         <option value="brown">theme brown</option>         <option value="blue">theme blue</option>         <option value="green">theme green</option>     </select> 

thanks, tharun.

if user able change theme of website, should save configuration on server side, , generate appropriate style tags server-side.

if not option, use cookies save on cookies. either way gonna need sort of storage, either client-side or server-side.

some options people point cookies, or local storage. neither of persistent or cross-platform. give thought save configuration on server.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -