EncodeURIComponent/decodeURIComponent

From NSB App Studio
Revision as of 21:05, 30 December 2013 by Ghenne (talk | contribs) (Created page with "encodeURIComponent(''URI'') decodeURIComponent(''URI'') == Description == The encodeURIComponent() function encodes a URI component. This function encodes special character...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

encodeURIComponent(URI)

decodeURIComponent(URI)

Description

The encodeURIComponent() function encodes a URI component. This function encodes special characters. In addition, it encodes the following characters: , / ? : @ & = + $ #

The decodeURIComponent() function decodes a URI component.

Example (Basic)

Encode a URI:

uri = "http://w3schools.com/my test.asp?name=st�le&car=saab"
Print "Encoded URI: " & encodeURIComponent(uri)

The result of res will be:

Encoded URI: http%3A%2F%2Fw3schools.com%2Fmy%20test.asp%3Fname%3Dst%C3%A5le%26car%3Dsaab

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

escape, unescape, encodeURIComponent, decodeURIComponent