Posted by: prajapatinilesh | September 17, 2007

Javascript encode/decode

Description:

A URI is composed of a sequence of components separated by component separators. The general form is:

Scheme : First / Second ; Third ? Fourth

where the italicised names represent components and the “:”, “/”, “;”, “&” and “?” are reserved characters used as separators.

encodeURI / decodeURI
The encodeURI and decodeURI functions are intended to work with complete URIs; they assume that any reserved characters in the URI are intended to have special meaning and so are not encoded.
encodeURIComponent / decodeURIComponent
The encodeURIComponent and decodeURIComponent functions are intended to work with the individual component parts of a URI; they assume that any reserved characters represent text and so must be encoded so that they are not interpreted as reserved characters when the component is part of a complete URI.
escape / unescape
Encodes a string so it can be read on all computers. Computes a new version of a string value in which certain characters have been replaced by a hexadecimal escape sequence. For those characters being replaced whose code point value is 0xFF or less, a two-digit escape sequence of the form %xx is used. For those characters being replaced whose code point value is greater than 0xFF, a four-digit escape sequence of the form %uxxxx is used. This should not be used to encode URIs.
encodeURL / decodeURL
See encodeURI / decodeURI above.
encodeURLComponent / decodeURLComponent
See encodeURIComponent / decodeURIComponent above.
Advertisements

Responses

  1. Sweet site, I hadn’t noticed prajapatinilesh.wordpress.com before in my searches!

    Drycleaning Equipment Martinizing Dry Cleaners CouponsCoin Washer And Dryer 24 Hour Cleaners


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: