0% found this document useful (0 votes)
2 views1 page

Custom JavaScript File For Joomla

The document includes JavaScript code that initializes jQuery and a custom jQuery plugin on page load. It also defines a public function that registers jQuery scripts with options for noConflict and Migrate. The scripts are loaded with automatic version detection and relative paths.

Uploaded by

lionelbatuoegbe
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Custom JavaScript File For Joomla

The document includes JavaScript code that initializes jQuery and a custom jQuery plugin on page load. It also defines a public function that registers jQuery scripts with options for noConflict and Migrate. The scripts are loaded with automatic version detection and relative paths.

Uploaded by

lionelbatuoegbe
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

<head>

<script src="/com_bar/js/[Link]"></script>
<script src="/media/jui/js/jquery-
[Link]?56690c624209a47cb536df0eac0a28f3"></script>
<script src="/media/jui/js/jquery-
[Link]?56690c624209a47cb536df0eac0a28f3"></script>
<script src="/com_foo/js/[Link]"></script>
jQuery(document).ready(function() {
jQuery('#selector').myJqueryPlugin();
})
</head>

public function onAfterInitialise()


{
JHtml::register('[Link]', function ($noConflict
= true, $debug = null, $migrate = true) {
JHtml::_('script', 'com_bar/[Link]',
array('version' => 'auto', 'relative' => true, 'detectDebug' =>
$debug));

// Check if we are loading in noConflict


if ($noConflict)
{
JHtml::_('script', 'jui/jquery-
[Link]', array('version' => 'auto', 'relative' => true));
}

// Check if we are loading Migrate


if ($migrate)
{
JHtml::_('script', 'jui/jquery-
[Link]', array('version' => 'auto', 'relative' => true,
'detectDebug' => $debug));
}
});
}

You might also like