title: How do I save the sort order of a jQueryUI Sortable list into localStorage
body: <p>I am using the jQueryUI Sortable function for an unordered list.  I would like to save the sorted order into the localstorage. What is the best way to do this?  I was thinking ajax but I'm not sure quite how to do that.</p>
  
  <p>Here is my source code so far.</p>
  
  <pre><code>&lt;ul id="wrapper"&gt;
      &lt;li class="grid_section" id="grid1"&gt;
          &lt;div class="grabber"&gt;
              &lt;h2&gt;Grid 1&lt;/h2&gt;
          &lt;/div&gt;&lt;!--/grabber--&gt;
      &lt;/li&gt;
  
      &lt;li class="grid_section" id="grid2"&gt;
          &lt;div class="grabber"&gt;
              &lt;h2&gt;Grid 2&lt;/h2&gt;
          &lt;/div&gt;
      &lt;/li&gt;
  
      &lt;li class="grid_section" id="grid3"&gt;
          &lt;div class="grabber"&gt;
              &lt;h2&gt;Grid 3&lt;/h2&gt;
          &lt;/div&gt;                                               
      &lt;/li&gt;
  &lt;/ul&gt;      
  </code></pre>
  
  <p>Here is my javascript:</p>
  
  <pre><code>$(document).ready(function() {
      $(function() {
          $("#wrapper").sortable({
              update: function () {
                  var order = $("#wrapper").sortable('toArray').toString();
                   console.log("Sorted : " + order);
                   $("#output").text(order);
  
                   $.ajax({                         
                       type: "POST",
                       data: "order=" + order,
                       dataType: "json",
                       success: function (order) {
                           console.log("Success" + order);
                       },
                       error: function (order) {
                           console.log("Failed" + order);
                       }
                   })
               },
               placeholder: "ui-state-highlight"
           }).disableSelection();
        });
    });
  </code></pre>
  
  <p>I can easily see the order and have it output but now I need to store that order in localStorage and have it called when the page loads.  I'm not sure localStorage is the best solution for this. </p>