urlencode instead. If you intend to target the browser, you can then use a module bundler such as Browserify, webpack or rollup. js. Encode URL with encodeURI. Description. encodeURI() is used to encode URIs to be passed to the browser. It is designed to work on an entire URI. encodeURI() does not encode special characters that are part of a URI, such as the colon, forward slash, question mark, and pound sign. URL Encoding Functions. 2 or better, so it doesnt work in Opera 3. Bei PHP wird der Link mit urlencode codiert und bei JS encodeuri. Tip: Use the decodeURI() function to decode an encoded URI.