DEVELOPER TOOL / 61
Encode the URL.
Keep it readable.
Encode query values, encode a complete URI, or decode percent-escaped text locally with the browser's native URL functions.
URL encoder and decoder
Use component encoding for individual query values. Full URI encoding keeps URL separators such as :, /, and ? readable where possible.
Advertisement
QUICK ANSWERS
What is the difference between encodeURI and encodeURIComponent?
encodeURI is intended for a complete URI and preserves structural separators. encodeURIComponent is intended for one value such as a query parameter.
Why did decoding fail?
The input may contain a stray percent sign or an incomplete escape sequence. Copy the encoded value exactly and try again.