js_escape

Head-related functions

Summary

js_escape(string $value)

Escape the value for use in javascript.

This is a convenience function for encoding a value using JSON notation.Must be used when interpolating PHP output in javascript. Note on usage: donot wrap the resulting output of this function in quotes, as proper JSONencoding will take care of that.

Parameters:
  • $value (string) –
Returns:

string

Usage

Examples

See Also

Project Versions

Table Of Contents

Previous topic

head_js

Next topic

js_tag

This Page