callJsFunction

fun callJsFunction(jsBody: String, vararg args: JsonElement)(source)

Calls a JavaScript function in the browser passing it the supplied parameters, which will be substituted into jsBody wherever a {} is present.

Notes:

  • The {} will be replaced by a variable so "one {} three" won't work, use '"one " + {} + " three"' instead.

  • If your JavaScript needs to use an empty JavaScript object, just insert a space between the {}s, eg. { } so it won't be treated as a parameter