jquery search GET anchor
<p>I need help getting hash search <em>bookmarkable</em>
So far I've got if I search something, it shows up <a href="http://site.com/" rel="nofollow">http://site.com/</a><strong>#searchedThing</strong>
but when I refresh or copy and paste the link to address bar, it wont show up that thing.</p>

<p><strong>index:</strong>
    </p>

<pre><code>&lt;input type="text" id="media"&gt;
&lt;input type="submit" id="media-search" value="Search"&gt;

    &lt;div id="media-list"&gt;&lt;/div&gt;
    &lt;script src="js/search.js"&gt;&lt;/script&gt;
</code></pre>

<p><strong>search.js</strong></p>

<pre><code>$('input#media-search').on('click', function() {
   var media = $('input#media').val();
      if ($.trim(media) != '') {
        $.post('search.php', {media: media}, function(data) {
            $('div#media-list').html(data);
            location.hash = "#search=" + media;
      });
   }
});
</code></pre>

<p><strong>search.php</strong></p>

<pre><code>if (isset($_POST['media']) === true &amp;&amp; empty($_POST['media']) === false) {
    require 'connect.php';

    $query = $db-&gt;prepare("SELECT `media`.`id`, 
                                  `media`.`title` 
                           FROM   `media` 
                           WHERE  `media`.`title` 
                           LIKE   :search
                          ");

    $query-&gt;bindValue(':search', '%' . $_POST['media'] . '%', PDO::PARAM_STR);

    $query-&gt;execute();

    if($query-&gt;rowCount() == 0) {
        echo 'File';
    }
    while ($row = $query-&gt;fetch(PDO::FETCH_ASSOC)) {    

        echo "&lt;li&gt;&lt;a href='#" . $row['id'] . "' name='" . $row['id'] . "'&gt;" . $row['title'] . "&lt;/a&gt;&lt;/li&gt;";      
    }
}
</code></pre>
