ActionView::Helpers::JavaScriptHelper
escape_javascript
API docs (Rails 8.1.4.1) ↗Alias: j
def escape_javascript(javascript)
Description
Returns the string with characters escaped so that it can go inside a JavaScript string.
ERB
Changes from the previous output: Added Removed Changed
HTML
Preview
Form submission
Form data
| name | value |
|---|
Request body
Content-Type:
params