You have been referred to this item:

Encoding Strings for URLs

Use encodeURIComponent() in favor of escape(), which is deprecated.

See: Comparing escape(), encodeURI(), and encodeURIComponent().