You can, however, very simply add jQuery.
N.B. The following is for Joomla 1.7.
For this particular application i need both the 'core' framework and jQueryUI.
I downloaded the libraries and put them into 'JOOMLA_HOME/media/system/js'.
Then, in the my custom component's Admin views I referenced them and initialised them like this:
- $document = &JFactory::getDocument();
- $document->addScript( '../media/system/js/jquery-1.7.1.js' );
- $document->addScript( '../media/system/js/jquery-ui-1.8.17.custom.min.js' );
- $document->addCustomTag( '<script type="text/javascript">jQuery.noConflict();</script>' );
Then, when ever you need to execute any jQuery functions (e.g. in document.ready) use the following syntax:
- <script type="text/javascript">
- jQuery(document).ready(function() {
- ...
- });
- </script>
Note, the '$' is replaced with an explicit 'jQuery' reference (to avoid conflict wit Mootools.
For the non-admin screens, its exactly same but the path to the jQuery files in the 'addScript' doesn't have a leading '../'.
No comments:
Post a Comment