$document = JFactory::getDocument(); $document->setTitle('New Page Title');
$document = JFactory::getDocument(); $document->addStyleSheet('path/to/stylesheet.css');
$document = JFactory::getDocument(); $document->addScript('path/to/script.js');This code retrieves the current document object and adds a new script to the page. The package library for the JFactory class is the Joomla Framework.