I tried to insert the Google ReCaptcha script to the page, but I couldn't select the global grecaptcha
.
val script = dom.document.createElement("script").asInstanceOf[HTMLScriptElement]
script.setAttribute("src", "https://www.google.com/recaptcha/api.js")
script.setAttribute("async", "true")
script.onload = { (_: Event) =>
println(Dynamic.global.selectDynamic("grecaptcha")) // --> got undefined
}
dom.document.body.appendChild(script)
In the Console window, I can get grecaptcha
:
The question is how to select global grecaptcha
object?