Encode URL

Encode a string for safe use in a URL by escaping special characters.

Code

Utilities
encodeURIComponent(str);

Parameters

The string to encode.

Browser·fetch() may be limited by CORS

More JavaScript Snippets