I can’t make e-search jquery plugin which remembers search value and start searching with remembered in localstorage phrases when page is loading

  javascript, jquery, plugins

I using this plugin: https://github.com/edukni/Search-input-jquery-plugin

and I use this code to remeber search input:

            $(document).ready(function() {
  $("#search").val(localStorage.getItem("name"));
      $('input.form-control.search-game').search(function(){

              //execute after done typing.
              localStorage.setItem("name", $('#search').val());
      });
});

It works with searching and rememebering data in localStorage, but when I reload page in search form
is display phrase from localStorage, but searching list display all elements, and don’t display only searched elements. Page loading takes 40s.

Thanks for help

Source: Ask Javascript Questions

LEAVE A COMMENT