You could use the decodeURIComponent function to convert the %xx into characters. However, to convert + into spaces you need to replace them in an extra step.
function urldecode(url) {
return decodeURIComponent(url.replace(/\+/g, ' '));
}
You could use the decodeURIComponent function to convert the %xx into characters. However, to convert + into spaces you need to replace them in an extra step.
function urldecode(url) {
return decodeURIComponent(url.replace(/\+/g, ' '));
}