Adds en- and decoding for URL hashes.
This commit is contained in:
parent
997f1cd80f
commit
08cc2834df
@ -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…
x
Reference in New Issue
Block a user