JavaScript: Encode URL, Escape String

By Xah Lee. Date: . Last updated: .
encodeURI/decodeURI
Percent encode URL.

[see encodeURI]

encodeURIComponent/decodeURIComponent
Like encodeURI but changes more chars, including slash and colon in http://.

[see encodeURIComponent]

escape/unescape
deprecated. Changes some characters to a percent encoded form of the char's Unicode codepoint.

[see escape]

Note: these functions are properties of the Global Object .

JavaScript/DOM, Get/Set URL

BUY ΣJS JavaScript in Depth