Swat/SwatUIObject.php
public function addJavaScript($java_script)
    {
        if ($this->html_head_entry_set === null) {
            throw new SwatException(
                sprintf(
                    "Child class '%s' did not " .
                        'instantiate a HTML head entry set. This should be done in  ' .
                        'the constructor either by calling parent::__construct() or ' .
                        'by creating a new HTML head entry set.',
                    get_class($this)
                )
            );
        }

        $this->html_head_entry_set->addEntry(
            new SwatJavaScriptHtmlHeadEntry($java_script)
        );
    }
public function addJavaScript($java_script)
    {
        if ($this->html_head_entry_set === null) {
            throw new SwatException(
                sprintf(
                    "Child class '%s' did not " .
                        'instantiate a HTML head entry set. This should be done in  ' .
                        'the constructor either by calling parent::__construct() or ' .
                        'by creating a new HTML head entry set.',
                    get_class($this)
                )
            );
        }

        $this->html_head_entry_set->addEntry(
            new SwatJavaScriptHtmlHeadEntry($java_script)
        );
    }
public function addJavaScript ( $ java_script ) { if ( $ this -> html_head_entry_set === null ) { throw new SwatException ( sprintf ( "Child class '%s' did not " . 'instantiate a HTML head entry set. This should be done in  ' . 'the constructor either by calling parent::__construct() or ' . 'by creating a new HTML head entry set.' , get_class ( $ this ) ) ) ; } $ this -> html_head_entry_set -> addEntry ( new SwatJavaScriptHtmlHeadEntry ( $ java_script ) ) ; }
Adds a JavaScript include to the list of JavaScript includes needed
by this user-interface element

@param string  $java_script the uri of the JavaScript include.
@param integer $display_order the relative order in which to display
this JavaScript head entry.
Adds a JavaScript include to the list of JavaScript includes needed by this user - interface element