Difference between revisions of "Adding Javascript moo.fx to your component"

From Joomla! Documentation

(Code change to fix "undeclared method" error)
m (Tutorial talk:Adding Javascript moo.fx to your component WIP moved to Talk:Adding Javascript moo.fx to your component WIP: Moved page to main namespace because the Tutorial namespace is deprecated)
(No difference)

Revision as of 09:37, 14 January 2011

I received an error ("Call to undefined method JSite::getDocument()") when I tried the tutorial. To fix it, I changed the code from:

// make mainframe variable available
global $mainframe;	
// Load the moo.fx scripts
$document = & $mainframe->getDocument();

to this:

// Load the moo.fx scripts
$document = & JFactory::getDocument();

--Rlfielding 00:03, 1 October 2008 (EDT)