URL Encoding
URLs can only contain a limited set of characters. Others are replaced with a percent sign and two hex digits: a space becomes %20 and a slash inside a value becomes %2F.
In JavaScript, encodeURIComponent() does this for you when you build a query string.
Example
https://example.com/search?q=hello%20world&lang=enExercise
Which code stands for a space in a URL?
my%file.pdf
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.