| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Application |
JApplication |
addCustomHeadTag |
addCustomHeadTag() |
Never | Internal Review |
Adds a custom HTML string to the head block of the current page being processed.
The method is deprecated and provided for backwards compatibility with Joomla! 1.0. It is scheduled to be removed in future versions. Use JDocumentHTML::addCustomTag instead.
void addCustomHeadTag ( $html )
| $html | string | the custom html element (tag) to add to the document head. |
The following code will insert a head element into the page that will link to the file samplejavascript.js.
Example
function insertCustomHeader() { global $mainframe; $customHead = '<script language="JavaScript" ' . 'src="samplejavascript.js" ' . 'type="text/javascript"></script>' ; $mainframe->addCustomHeadTag( $customHead ); } insertCustomHeader();