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 = '';
|
||||
$.each($.extend({}, hash(), obj), function (key, value) {
|
||||
if (value) {
|
||||
hashStr += '/' + key + '=' + value;
|
||||
hashStr += '/' + encodeURIComponent(key) + '=' + encodeURIComponent(value);
|
||||
}
|
||||
});
|
||||
hashStr = '#!' + hashStr;
|
||||
|
@ -66,7 +66,7 @@
|
|||
|
||||
var match = /^([^=]*)=(.*?)$/.exec(part);
|
||||
if (match) {
|
||||
result[match[1]] = match[2];
|
||||
result[decodeURIComponent(match[1])] = decodeURIComponent(match[2]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue