public function addOnReady($js)
    {
        if ($js instanceof jQuery_Chain) {
            $js = $js->getString();
        }
        if (!$this->atk4_initialised) {
            return parent::addOnReady($js);
        }

        $this->app->template->appendHTML('document_ready', "$.atk4(function(){ ".$js."; });\n");

        return $this;
    }
public function addOnReady($js)
    {
        if ($js instanceof jQuery_Chain) {
            $js = $js->getString();
        }
        if (!$this->atk4_initialised) {
            return parent::addOnReady($js);
        }

        $this->app->template->appendHTML('document_ready', "$.atk4(function(){ ".$js."; });\n");

        return $this;
    }
public function addOnReady ( $ js ) { if ( $ js instanceof jQuery_Chain ) { $ js = $ js -> getString ( ) ; } if ( ! $ this -> atk4_initialised ) { return parent :: addOnReady ( $ js ) ; } $ this -> app -> template -> appendHTML ( 'document_ready' , "$.atk4(function(){ " . $ js . "; });\n" ) ; return $ this ; }
Adds JS chain to DOM onReady event

@param jQuery_Chain|string $js

@return $this
Adds JS chain to DOM onReady event