mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-28 14:04:45 -04:00
Adds en- and decoding for URL hashes.
This commit is contained in:
parent
997f1cd80f
commit
08cc2834df
1 changed files with 2 additions and 2 deletions
|
@ -50,7 +50,7 @@
|
||||||
var hashStr = '';
|
var hashStr = '';
|
||||||
$.each($.extend({}, hash(), obj), function (key, value) {
|
$.each($.extend({}, hash(), obj), function (key, value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
hashStr += '/' + key + '=' + value;
|
hashStr += '/' + encodeURIComponent(key) + '=' + encodeURIComponent(value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
hashStr = '#!' + hashStr;
|
hashStr = '#!' + hashStr;
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
|
|
||||||
var match = /^([^=]*)=(.*?)$/.exec(part);
|
var match = /^([^=]*)=(.*?)$/.exec(part);
|
||||||
if (match) {
|
if (match) {
|
||||||
result[match[1]] = match[2];
|
result[decodeURIComponent(match[1])] = decodeURIComponent(match[2]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue