addJSCode: Insert JavaScript code into a (HTML) document

Description Usage Arguments Value Author(s)

Description

This function and its methods add JavaScript code into an HTML document.

Usage

1
addJSCode(to, code, src = character(), attrs = c(type = "application/x-javascript"), ...)

Arguments

to

the document into which the code is to be inserted

code

the code. Either a character vector or an AsIs character vector. If this is an AsIs object, the character vector is taken as the names of files or URLs and these are added as references to those files rather than inserting the contents of those objects. For regular character vectors, the contents are inserted.

src

the original name of the file from which the code came. This is used when code is not AsIs and it is addeds as the value of the attribute originalURL.

attrs

a named character vector giving the attributes for the script node being added.

...

additional parameters

Value

A new XML node that is added to the HTML document.

Author(s)

Duncan Temple Lang


omegahat/RJSCanvasDevice documentation built on May 24, 2019, 1:54 p.m.