May 7, 2000 - ASCII-URI Conversions
May 7, 2000 ASCII-URI Conversions Tips: May 2000
Yehuda Shiran, Ph.D.
|
Internet Explorer 5.5 introduced four new methods to encode strings to URIs as well as to decode URIs to strings. The first method, encodeURI(string)
, encodes a string as a full URI. Let's take an example. The following line:
encodeURI("My phone # is 123-456-7890"));
should generate the following string:
My%20phone%20#%20is%20123-456-7890
The other three methods are encodeURIComponent()
, decodeURI()
, and decodeURIComponent()
. Read all about them in Column 59, IE 5.5: Formatting, URIs, and Stack Operations.