Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is a <a href="https://github.com/carhartl/jquery-cookie" rel="nofollow">jQuery cookie plugin</a> there are examples on that page as well so you can see how you can set and read a value from the cookie.</p> <p>Once the value is read it's just a simple matter of loading the right theme.</p> <pre><code>var theme = $.cookie('name_of_selected_theme'); setTheme(theme); function setTheme(themeName){ if(themeName == "One"){ ... }else... } </code></pre> <p>However cookies only allow for 4KB of data and are passed in every HTTP call. A better idea many be localStorage. You can use <a href="http://yuilibrary.com/gallery/show/storage-lite" rel="nofollow">YUI Storage Lite library</a> which is &lt; 3KB in size and you can easily use it to save data in browser localStorage and load from it. You can save at least 5MB of data using localStorage. </p> <p>Example code from the link above:</p> <pre><code>YUI({ //Last Gallery Build of this module gallery: 'gallery-2010.12.01-21-32' }).use('gallery-storage-lite', function (Y) { // For full compatibility with IE 6-7 and Safari 3.x, you should listen for // the storage-lite:ready event before making storage calls. If you're not // targeting those browsers, you can safely ignore this step. Y.StorageLite.on('storage-lite:ready', function () { // To store an item, pass a key and a value (both strings) to setItem(). Y.StorageLite.setItem('kittens', 'fluffy and cute'); // If you set the optional third parameter to true, you can use any // serializable object as the value and it will automatically be stored // as a JSON string. Y.StorageLite.setItem('pies', ['apple', 'pumpkin', 'pecan'], true); // To retrieve an item, pass the key to getItem(). Y.StorageLite.getItem('kittens'); // =&gt; 'fluffy and cute' // To retrieve and automatically parse a JSON value, set the optional // second parameter to true. Y.StorageLite.getItem('pies', true); // =&gt; ['apple', 'pumpkin', 'pecan'] // The length() method returns a count of how many items are currently // stored. Y.StorageLite.length(); // =&gt; 2 // To remove a single item, pass its key to removeItem(). Y.StorageLite.removeItem('kittens'); // To remove all items in storage, call clear(). Y.StorageLite.clear(); }); }); </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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