yii\captcha\Captcha::registerClientScript PHP Method

registerClientScript() public method

Registers the needed JavaScript.
    public function registerClientScript()
    {
        $options = $this->getClientOptions();
        $options = empty($options) ? '' : Json::htmlEncode($options);
        $id = $this->imageOptions['id'];
        $view = $this->getView();
        CaptchaAsset::register($view);
        $view->registerJs("jQuery('#{$id}').yiiCaptcha({$options});");
    }