Advertisement
728x90
The encodeURI() function is used to encode complete URI which has special characters except (, / ? : @ & = + $ #) characters.
javascript
1var uri = "https://mozilla.org/?x=шеллы";
2
3var encoded = encodeURI(uri);
4
5console.log(encoded); // https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8BAdvertisement
Responsive Ad
🎯 Practice NowRelated Challenge
JavaScript Coding Exercise 41
Test your knowledge with this interactive coding challenge.
Start CodingAdvertisement
728x90
211of476