JavaScript URL Decode function
I've used encodeURIComponent() and decodeURIComponent() too.
Here is a complete function (taken from PHPJS):
function urldecode(str) {
return decodeURIComponent((str+'').replace(/\+/g, '%20'));
}
Use this
unescape(str);
I'm not a great JS programmer, tried all, and this worked awesome!