Documentation

addJs

boolean public
\Bitrix\Main\Page\Asset::addJs(
  $path,
 boolean $additional = false
);

Non-static method adds js to the site's <head>…</head> section.

Similar to the method CMain::AddHeadScript in the old core.

Parameters

ParameterDescriptionVersion
$path
$additional

Example

use Bitrix\Main\Page\Asset;

Asset::getInstance()->addJs(SITE_TEMPLATE_PATH . "/js/fix.js");


© «Bitrix24», 2001-2024
Up