Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the opposite of escape, in javascript?

Tags:

javascript

Right now, it is displayed as:

how %26 why

It should be:

how & why
like image 569
TIMEX Avatar asked Oct 21 '09 22:10

TIMEX


People also ask

What can I use instead of escape in JavaScript?

The escape() function is deprecated. Use encodeURI() or encodeURIComponent() instead.

How do you unescape in JavaScript?

The unescape() function computes a new string in which hexadecimal escape sequences are replaced with the character that it represents. The escape sequences might be introduced by a function like escape . Usually, decodeURI or decodeURIComponent are preferred over unescape .

What is unescape () and escape () functions?

1. The unescape() function is used to decode that string encoded by the escape() function. The escape() function in JavaScript is used for encoding a string.

What is escape JavaScript?

Definition and Usage The escape() function was deprecated in JavaScript version 1.5. Use encodeURI() or encodeURIComponent() instead. The escape() function encodes a string. This function makes a string portable, so it can be transmitted across any network to any computer that supports ASCII characters.


1 Answers

That would be unescape().

2017 Edit: I should note that unescape() has now been deprecated in favour of decodeURI() and decodeURIComponent(). Also, escape() has been deprecated in favour of encodeURI and encodeURIComponent() respectively.

At least they are fairly obvious opposites.

like image 132
Robert Massaioli Avatar answered Sep 28 '22 18:09

Robert Massaioli