Global escape() Function - Javascript Global

Javascript examples for Global:escape

Description

The escape() function encodes a string and was deprecated in JavaScript version 1.5. Use encodeURI() or encodeURIComponent() instead.

This function encodes special characters, with the exception of: * @ - _ + . /

Parameter Values

Parameter Description
stringRequired. The string to be encoded

Return Value:

A String, representing the encoded string

The following code shows how to Encode a string:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<script>

document.write(escape(" I^%&%%$%$# !"));

</script>//from   www . j a va  2s.  com

</body>
</html>

Related Tutorials