<div class="literally localstorage"></div>

<script>
  $(document).ready(function() {
    var lc = LC.init(
      document.getElementsByClassName('literally localstorage')[0]);
    var localStorageKey = 'drawing'
    if (localStorage.getItem(localStorageKey)) {
      lc.loadSnapshotJSON(localStorage.getItem(localStorageKey));
    }
    lc.on('drawingChange', function() {
      localStorage.setItem(localStorageKey, lc.getSnapshotJSON());
    });
  });
</script>

<div class="literally localstorage"></div>

<script>
  $(document).ready(function() {
    var lc = LC.init(
      document.getElementsByClassName('literally localstorage')[0]);
    var localStorageKey = 'drawing'
    if (localStorage.getItem(localStorageKey)) {
      lc.loadSnapshot(JSON.parse(localStorage.getItem(localStorageKey)));
    }
    lc.on('drawingChange', function() {
      localStorage.setItem(localStorageKey, JSON.stringify(lc.getSnapshot()));
    });
  });
</script>

Stop using deprecated snapshot methods
Stop using deprecated snapshot methods
