EncodeURI/decodeURI: Difference between revisions
Jump to navigation
Jump to search
Line 7: | Line 7: | ||
The encodeURI() function is used to encode a URI. | The encodeURI() function is used to encode a URI. | ||
This function encodes special characters, except: , / ? : @ & = + $ # (Use encodeURIComponent() to encode these characters). | This function encodes special characters, except: , / ? : @ & = + $ # (Use [[encodeURIComponent]]() to encode these characters). | ||
unEscape converts a string with special characters turned into a normal string. | unEscape converts a string with special characters turned into a normal string. |
Revision as of 21:00, 30 December 2013
encodeURI(URI)
decodeURI(URI)
Description
The encodeURI() function is used to encode a URI.
This function encodes special characters, except: , / ? : @ & = + $ # (Use encodeURIComponent() to encode these characters).
unEscape converts a string with special characters turned into a normal string.
Example (Basic)
Encode a URI:
uri = "my test.asp?name=st�le&car=saab" Print encodeURI(uri)
The result of res will be:
my%20test.asp?name=st%C3%A5le&car=saab
Example (JavaScript)
Encode a URI:
var uri = "my test.asp?name=st�le&car=saab"; NSB.Print(encodeURI(uri));
The result of res will be:
my%20test.asp?name=st%C3%A5le&car=saab
Related Items
encodeURI, decodeURI, encodeURIComponent, decodeURIComponent