change url with history.pushState
<p>I have a page with products and 1 filter bar.</p>

<p>filter bar has 2 options:</p>

<ol>
<li>category </li>
<li>subcategory.</li>
</ol>

<p>I want every time I select category display all items and when i select subcategory display only items of this subcategory, something like : </p>

<pre><code>category -&gt; tv and subcategory -&gt; samsung ,lg, sony. 
</code></pre>

<p>Every time i select category i load items with ajax and when i select subcategory i hide everything is not in the selected subcategory with jquery.</p>

<p>So i need every time i am pressing selectors to change the url like : <code>localhost/tv</code> or <code>localhost/tv/sony</code>.</p>

<p>I found <strong>historyPushstate</strong> but the problem is that when i press the back button the page doesn't display the previous content.</p>

<p>I found <strong>history.js</strong> on github and similar questions but they are old.I want to ask :</p>

<ol>
<li>Can i use jquery  when i click the back button on browser</li>
<li>Is history.js still good or i have to find something newer for that purpose?</li>
</ol>