title: jquery JSON array as localStorage item
body: <p>Little change of my code and it's partially works :)</p>
  
  <pre><code>    var db = {
          hotels: JSON.parse(localStorage.getItem('table') || "[]"),
  
          get objects() {return this.hotels},
          set objects(obj) {
              obj = this.hotels;
              localStorage.setItem('table', JSON.stringify(obj))
          }
      }
  
  
  
  jQuery(function(){
  
      var count = localStorage.getItem('count');
      if(!count) {
       count = 0;
      }
  
  
      function Add(item){
          var client = {
              ID    : jQuery(item).find("#txtID").val(),
              Name  : jQuery(item).find("#txtName").val(),
              Photo : jQuery(item).find("#txtPhone").val(),
              Link : jQuery(item).find("#txtEmail").val()
          };
          db.objects = db.objects.push(client);
          count = count+1;
          localStorage.setItem('count',count);
  
          jQuery('.panel2 a span').text('('+ localStorage.getItem('count') +')');
  
          jQuery(item).find('.add_rem').hide();
          jQuery(item).find('.remove').show();
          jQuery("#tblList .empty").hide();
          jQuery("#tblList").find('li:gt(0)').remove();
  
          jQuery.each(db.objects,function(i,element) {
              jQuery("#tblList").append("&lt;li class='added"+db.objects[i].ID+"'&gt;"+
                                           "&lt;img src='../../images/general/delete.gif' alt='Delete"+i+"' class='delete'/&gt;" +
                                           "&lt;a href='"+db.objects[i].Link+"' title='"+db.objects[i].Name+"'&gt;"+
                                           "  &lt;img src='"+db.objects[i].Photo+"' alt='"+db.objects[i].Name+"'&gt;" + 
                                           "  &lt;span&gt;"+db.objects[i].Name+"&lt;/span&gt;" + 
                                           "  &lt;/a&gt;" + 
                                        "&lt;/li&gt;");
          })
          return true;
      }
  
      function Delete(item){
                  jQuery(item).prev('.add_rem').show();
                  jQuery(item).find('.remove').hide();
                  jQuery(item).find('.remove').removeAttr('alt');
  
      }
  
      function List(){
          if(count &gt; 0) {
              jQuery("#tblList .empty").hide();
              jQuery('.panel2 a span').text('('+ localStorage.getItem('count') +')');
          }
          for(var i= 0; i&lt;= count; i++) {
           var cli = JSON.parse(db.hotels);
              if(cli[i] != null){
                  jQuery("#"+cli[i].ID).find('.add_rem').hide();
                  jQuery("#"+cli[i].ID).find('.remove').show();
                  jQuery("#"+cli[i].ID).find('.remove').attr('alt','Delete'+i);
                  jQuery("#tblList").append("&lt;li class='added"+cli[i].ID+"'&gt;"+
                                           "&lt;img src='../../images/general/delete.gif' alt='Delete"+i+"' class='delete'/&gt;" +
                                           "&lt;a href='"+cli[i].Link+"' title='"+cli[i].Name+"'&gt;"+
                                           "  &lt;img src='"+cli[i].Photo+"' alt='"+cli[i].Name+"'&gt;" + 
                                           "  &lt;span&gt;"+cli[i].Name+"&lt;/span&gt;" + 
                                           "  &lt;/a&gt;" + 
                                        "&lt;/li&gt;");
              }
          }
      }
  
      jQuery("#frmCadastre").bind('submit',function(e){   
         e.preventDefault()   
              return Add(this);
      });
          List();
  
      jQuery(".remove, .delete").bind("click", function(e){
          e.preventDefault();
          Delete(this);
          List();
      });
  
  })
  </code></pre>
  
  <p>now my question is how to push element to array  after page refresh this is located in <code>function Add()</code></p>
  
  <p>array looks like this</p>
  
  <pre><code>"["{"ID":"1","Name":"test","photo":"/link/to/photo.jpg"}"]"
  </code></pre>
  
  <p>and if i add another element before page refresh it works great</p>
  
  <pre><code>"["{"ID":"0","Name":"test0","photo":"/link/to/photo0.jpg"}","{"ID":"1","Name":"test1","photo":"/link/to/photo1.jpg"}"]"
  </code></pre>
  
  <p>but if i Reload page and try to add an element Firebug is throwing:</p>
  
  <pre><code> `TypeError: db.objects.push is not a function  
  
   db.objects = db.objects.push(client);`
  </code></pre>