Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would just use the URL and some sort of hashbang (GETish) functionality. So each time someone does a search, the URL changes, and each time the page is loaded, it looks at the URL for search parameters and if they exist, runs a search...</p> <p>There is a nice GIST on this with a full explanation of the code below: <a href="https://gist.github.com/miohtama/1570295" rel="nofollow">https://gist.github.com/miohtama/1570295</a></p> <pre><code>function parseHashBangArgs(aURL) { aURL = aURL || window.location.href; var vars = {}; var hashes = aURL.slice(aURL.indexOf('#') + 1).split('&amp;'); for(var i = 0; i &lt; hashes.length; i++) { var hash = hashes[i].split('='); if(hash.length &gt; 1) { vars[hash[0]] = hash[1]; } else { vars[hash[0]] = null; } } return vars; </code></pre> <p>}</p> <p>OK in reference to your question for HOW to use this: I have made a working example (code below), but you will have to implement in your own code (I cant do literally everything for you)...</p> <pre><code>&lt;input id="searchBar" type="text" value="enter search here" /&gt;&lt;br /&gt; &lt;input id="theButton" type="button" name="" value="getHash" /&gt;&lt;br /&gt; Hash value is: &lt;a id="hashValue"&gt;&lt;/a&gt; jQuery(document).ready(function ($) { $('#searchBar').change(function() { search(document.getElementById('searchBar').value) }); $('#theButton').click(function() { getHash(); }); }) function search(searchTerms){ location.hash = "searchTerm="+searchTerms; } function getHash(){ var hashObj= new Object(); hashObj=(parseHashBangArgs()) document.getElementById('hashValue').innerHTML=hashObj.searchTerm; } function parseHashBangArgs(aURL) { ... code from GIST above... </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload