At main.js:17 the location.hash is being updated multiple times as the user types in their query. The search function seems to work fine but clicking the back button causes the app to backtrack through each incremental search update. e.g. If the user searches for "asdf", the 1st back button click sets location.hash to "asd", the 2nd to "as", and so on.
This might easily be resolved by using a debounce function from a library like lodash, e.g.
$('table').on('search.dt', _.debounce(function(e, settings) {
var query = $("input[type=search]").val();
if (query)
location.hash = QueryString.stringify({q: query});
...
}, 1000));
At main.js:17 the
location.hash
is being updated multiple times as the user types in their query. The search function seems to work fine but clicking the back button causes the app to backtrack through each incremental search update. e.g. If the user searches for "asdf", the 1st back button click sets location.hash to "asd", the 2nd to "as", and so on.This might easily be resolved by using a debounce function from a library like lodash, e.g.