How to use the forward slash instead of ugly '%2F'

tkyk edited this page Apr 29, 2011 · 1 revision

How to use the forward slash '/' instead of ugly '%2F'

Set 'unescape' option of $.history.init to make special characters literal.

// unescape "/", ",", and "&"
$.history.init(callback, { unescape: "/,&" });

// unescape all characters (does not escape characters at all. Danger and not recommended.)
$.history.init(callback, { unescape: true });

// custom function
$.history.init(callback, { unescape: function(encodedHash){ /* your own unescape logic */ }});

// escape all the special characters using encodeURIComponent (default)
$.history.init(callback, { unescape: false });