mirror of
https://github.com/thewesker/greptweet.git
synced 2025-12-21 12:41:04 -05:00
Using window.location.hash to stop page reload, closes #20
This commit is contained in:
10
main.js
10
main.js
@@ -55,13 +55,15 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
$("input[type=search]").change(function() {
|
$("input[type=search]").change(function() {
|
||||||
query = this.value;
|
query = this.value;
|
||||||
// Still a bug dispite FALLBACK in Appcache whereby Safari on Iphone gives an error message
|
window.location.hash = query;
|
||||||
//window.location.search = query; // Triggers Reload the page to get source for: http://greptweet/u/kaihendry/?food
|
|
||||||
grep(query);
|
grep(query);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (window.location.search) {
|
if (window.location.search || window.location.hash) {
|
||||||
searchquery = window.decodeURIComponent(window.location.search.substr(1));
|
if (!window.location.hash) {
|
||||||
|
window.location.hash = window.location.search.substr(1);
|
||||||
|
}
|
||||||
|
searchquery = window.decodeURIComponent(window.location.hash.substr(1));
|
||||||
$("input[type=search]").val(searchquery);
|
$("input[type=search]").val(searchquery);
|
||||||
grep(searchquery);
|
grep(searchquery);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user