How to add async to javascript tag?

Questions related to the configuration of Joomla, Templates, and Security related questions/issues
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Tue Jan 07, 2014 6:38 pm
Hi Guys

How do I add async to the JavaScript link below?

$this->API->addJS($this->API->URLtemplate() . '/js/gk.scripts.js');
$this->API->addJS($this->API->URLtemplate() . '/js/gk.menu.js');


This is what I have now:
<script type="text/javascript" src="/sub1/beta2/media/system/js/mootools-core.js"></script>

I would like to have it like this:
<script async type="text/javascript" src="/sub1/beta2/media/system/js/mootools-core.js"></script>
User avatar
Fresh Boarder

GK User
Tue Jan 07, 2014 8:33 pm
This function does nithing more than calling of Joomla root function:
Code: Select all
$doc =& JFactory::getDocument();
$doc->addScript("http://www.example.com/js/myscript.js");

so you would need to fin how to hack into Joomla core finction to change that.
Or you could just place final code manually in place of '$this->API->addJS' callout.
User avatar
Moderator


cron