How can I insert js scripts before </body>

by Fotis Emery   Last Updated December 28, 2017 04:10 AM

I know this question is been asked again, but i tried their solution and it doesn't work so please don't rate it down. I have an authentication script (auth.js) that needs to be placed before the tag, but even when I apply the solution offered in the topic, it is still added in the header file instead of the body file. Here is the existing code. I am using Gantry5:

$document=JFactory::getDocument();
$document->addScript('/templates/rt_kraken/js/auth.js', 'text/javascript',false,true);

As I am a beginner please explain thoroughly as I still don't have the reputation here to comment back hahahha

Also this the link on the previous post,I am trying to achieve the same exact thing as them: Load javascript script before </body> closing tag



Related Questions



Trying to update gantry package, get this error

Updated August 23, 2017 21:10 PM