Description Usage Arguments Value Author(s) See Also Examples
Register an R function as a callback. This allows callbacks to not pollute the global environment.
1 | registerCallback(f, name = deparse(substitute(f)))
|
f |
A function that will be called following a DOM request
such as |
name |
The name by which the function will be known. This is the name that must be used in the DOM request. |
Called for its side-effect of registering the callback function.
Paul Murrell
1 2 3 4 5 6 7 8 9 10 11 12 13 | cbgen <- function() {
count <- 0
function(value) {
count <<- count + 1
cat(count, "\n")
}
}
cb <- cbgen()
registerCallback(cb)
headlessPage <- htmlPage(client=phantomClient)
appendChild(headlessPage, htmlNode("<p>test</p>"), callback=cb)
appendChild(headlessPage, htmlNode("<p>test</p>"), callback=cb)
closePage(headlessPage)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.