Personal web server - 1128 Part IV . JavaScript Core Language Reference
1128 Part IV . JavaScript Core Language Reference Global functions are not tied to the document object model. Instead, they typi cally enable you to convert data from one type to another type. The list of global statements is short, but a couple of them appear extensively in your scripting. Functions decodeURI( encodedURI ) decodeURIComponent( encodedURIComponent ) encodeURI( URIString ) encodeURIComponent( URIComponentString ) Returns: String. NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . The ECMA-262 Edition 3 standard, as implemented in IE5.5 and NN6, provides utility functions that perform a more rigorous conversion of strings to valid URI strings and vice versa than was achieved earlier via the escape() and unescape() functions (described later in this chapter). The purpose of the encoding functions is to convert any string to a version that you can use as a Uniform Resource Identifier, such as a Web page address or an invocation of a server CGI script. While Latin alphanumeric characters pass through the encoding process untouched, you must use the encoding functions to convert some symbols and other Unicode characters to a form (hexadecimal representations of the character numbers) that the Internet can pass from place to place. The space character, for example, must be encoded to its hex version: %20. Perhaps the biggest difference between the encodeURI() and escape()functions (and their decodeURI() and unescape()counterparts) is that the more modern versions do not encode a wide range of symbols that are perfectly acceptable as URI characters according to the syntax recommended in RFC2396 (http://www.ietf.org/rfc/rfc2396.txt). Thus, the following characters are not encoded via the encodeURI() function: ; / ? : @ & = + $ , - _ . ! ~ * ( ) # Use the encodeURI() and decodeURI() functions only on complete URIs. Applicable URIs can be relative or absolute, but these two functions are wired especially so symbols that are part of the protocol (://), search string (? and =, for instance), and directory level delimiters (/) are not encoded. The decodeURI() function should work with URIs that arrive from servers as page locations, but be aware that some server CGIs encode spaces into plus symbols (+) that are not decoded back to spaces by the JavaScript function. If the URIs your script needs to decode contain plus symbols in place of spaces, you need to run your decoded URI through a string replacement method to finish the job (regular expressions come in decodeURI()
In case you need quality webspace to host and run your web applications, try our personal web hosting services.