JS

0th

Percentile

Mark character strings as literal JavaScript code

This function JS() marks character vectors with a special class, so that it will be treated as literal JavaScript code when evaluated on the client-side.

Usage
JS(...)
Arguments
...

character vectors as the JavaScript source code (all arguments will be pasted into one character string)

Aliases
  • JS
Examples
# NOT RUN {
library(htmlwidgets)
JS('1 + 1')
list(x = JS('function(foo) {return foo;}'), y = 1:10)
JS('function(x) {', 'return x + 1;', '}')
# }
Documentation reproduced from package htmlwidgets, version 1.2, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.