FOF30\View\View::addJavascriptFile PHP Метод

addJavascriptFile() публичный Метод

There are three combinations of defer and async (see http://www.w3schools.com/tags/att_script_defer.asp): * $defer false, $async true: The script is executed asynchronously with the rest of the page (the script will be executed while the page continues the parsing) * $defer true, $async false: The script is executed when the page has finished parsing. * $defer false, $async false. (default) The script is loaded and executed immediately. When it finishes loading the browser continues parsing the rest of the page. When you are using $defer = true there is no guarantee about the load order of the scripts. Whichever script loads first will be executed first. The order they appear on the page is completely irrelevant.
public addJavascriptFile ( string $uri, string $version = null, string $type = 'text/javascript', boolean $defer = false, boolean $async = false )
$uri string A path definition understood by parsePath, e.g. media://com_example/js/foo.js
$version string (optional) Version string to be added to the URL
$type string MIME type of the script
$defer boolean Adds the defer attribute, see above
$async boolean Adds the async attribute, see above
    public function addJavascriptFile($uri, $version = null, $type = 'text/javascript', $defer = false, $async = false)
    {
        // Add an automatic version if $version is null. For no version parameter pass an empty string to $version.
        if (is_null($version)) {
            $version = $this->container->mediaVersion;
        }
        $this->container->template->addJS($uri, $defer, $async, $version, $type);
        return $this;
    }