mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-08-05 21:07:26 +02:00
Adds en- and decoding for URL hashes.
This commit is contained in:
@@ -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]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user