Adds en- and decoding for URL hashes.

This commit is contained in:
Lars Jung 2012-02-24 00:01:43 +01:00
parent 997f1cd80f
commit 08cc2834df

View file

@ -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]);
}
});
}