JSContext-method-source | R Documentation |
Evaluate a provided JavaScript file or string within the initialised context.
Note that this method should only be used for initialising functions or values
within the context, no values are returned from this function. See the $call()
method for returning values.
source(file = NULL, code = NULL)
file |
A path to the JavaScript file to load |
code |
A single string of JavaScript to evaluate |
An object of class NULL
of length 0.
No return value, called for side effects
## Not run:
ctx <- JSContext$new()
ctx$source(file = "path/to/file.js")
ctx$source(code = "1 + 2")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.