Skip to content

Instantly share code, notes, and snippets.

@mhawksey
Last active December 13, 2015 23:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mhawksey/4995998 to your computer and use it in GitHub Desktop.
Save mhawksey/4995998 to your computer and use it in GitHub Desktop.
Enter this on your index.html just before end <body> tag
<script type="text/javascript">
$(document).ready(function() {
var hash = window.location.hash.replace(/^[#\/]*/, '');
var request = hash.split('/', 2);
var type = request[0];
var term = request[1];
if (type === "search"){
$(".search-query").val(term);
$(".navbar-search").submit();
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment