How can I decode a URL using jQuery? My url is
http%3A%2F%2Fdtzhqpwfdzscm.cloudfront.net%2F4ca06373624db.jpg
kinda de-facto standard yes. but only in modern browsers. its done for user convienience, so you can put utf8 charactesr in an url and its still pretty to the human eye. however please be aware that the text is actually still encoded and will be transmittet/requested encoded, it is only displayed decoded.
The encodeURIComponent() function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two "surrogate" characters).
Try the decodeURIComponent function:
var decodedUri = decodeURIComponent('http%3A%2F%2Fdtzhqpwfdzscm.cloudfront.net%2F4ca06373624db.jpg'); alert(decodedUri);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With