Actions

Difference between revisions of "Adding JavaScript"

From Joomla! Documentation

(Inline JavaScript: only variables should be returned by reference)
(External JavaScript)
Line 32: Line 32:
 
<source lang="php">
 
<source lang="php">
 
<?php
 
<?php
$document = &JFactory::getDocument();
+
$document = JFactory::getDocument();
 
$document->addScript('/media/system/js/sample.js');
 
$document->addScript('/media/system/js/sample.js');
 
?>
 
?>

Revision as of 11:34, 10 February 2013