WordPress at a glance
function is not described

js_escape() WP 2.0.4

Deprecated from version 2.8.0. It is no longer supported and can be removed in future releases. Use esc_js() instead.

Escape single quotes, specialchar double quotes, and fix line endings.

The filter 'js_escape' is also applied by esc_js().

No Hooks.

Return

String. Escaped text.

Usage

js_escape( $text );
$text(string) (required)
The text to be escaped.

Notes

  • See: esc_js()

Changelog

Since 2.0.4 Introduced.
Deprecated Since 2.8.0 Use esc_js()

Code of js_escape() WP 5.7

<?php
function js_escape( $text ) {
	_deprecated_function( __FUNCTION__, '2.8.0', 'esc_js()' );
	return esc_js( $text );
}