Actions

CodeExample

Difference between revisions of "4bcfd994b6e12"

From Joomla! Documentation

(CodeExample provided by Chris Davenport (on behalf of Corin))
 
m (Removed SeeAlso: reference)
 
Line 11: Line 11:
 
$document->addScriptDeclaration("window.addEvent('load', function() { doSomething(); })");
 
$document->addScriptDeclaration("window.addEvent('load', function() { doSomething(); })");
 
</source>
 
</source>
{{SeeAlso:JDocument/addScriptDeclaration}}
 
  
 
<div class='comment-signature'>[[User:Chris Davenport|Chris Davenport]] 01:07, 22 April 2010 (EDT) [[CodeExample:4bcfd994b6e12 |Edit comment]]</div></div></div>  
 
<div class='comment-signature'>[[User:Chris Davenport|Chris Davenport]] 01:07, 22 April 2010 (EDT) [[CodeExample:4bcfd994b6e12 |Edit comment]]</div></div></div>  
  
 
[[Category:JHTMLBehavior]] [[Category:mootools]] [[Category:CodeExample]] [[Category:MethodExample]]
 
[[Category:JHTMLBehavior]] [[Category:mootools]] [[Category:CodeExample]] [[Category:MethodExample]]

Latest revision as of 00:10, 22 April 2010

A typical example of loading MooTools

// This example depends on mootools
JHTML::_('behavior.mootools');
 
// Do something after page has loaded
$document =& JFactory::getDocument();
$document->addScriptDeclaration("window.addEvent('load', function() { doSomething(); })");
Chris Davenport 01:07, 22 April 2010 (EDT) Edit comment