Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReferenceError: Joomla is not defined

I am developing a joomla component. It is executing but giving

ReferenceError: Joomla is not defined

I check that default java scripts like motool.js core.js are not loading.

How can I load them automatically and not manually like <script src=""></script>?.

like image 364
Vinay Mehta Avatar asked Apr 16 '26 08:04

Vinay Mehta


2 Answers

JHTML::_('behavior.mootools');

should load mootools.

If core is not loaded then run

JHtml::_('script', 'system/core.js', false, true);
like image 64
Laoneo Avatar answered Apr 17 '26 22:04

Laoneo


my problem was with public $live_site var in configuration.php. I didn't use http:// prefix before it, so all links to scripts in admin panel looked like http://mycoolsite.com/administartor/mycoolsite.com/media/system/js/script.js

That's why Joomla Object was not loading. Hope this will help someone.

like image 24
vladkras Avatar answered Apr 17 '26 23:04

vladkras



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!