Forums

Load JS File

Austre 14 Jun, 2017
At CFv5 we had a Load Javascript to use at Setup Tab and insert the URL files at JS Files field. With CFv6 how can we do that?
GreyHead 14 Jun, 2017
Hi Austre,

There is a JavaScript action in the Custom panel on the Designer tab. I don't' see how you load a file - I think that Max posted an answer but I don't see it right now. You can always use the Joomla! Document method
<?php
$jdoc = \JFactory::getDocument();
$jdoc->addScript('. . . ');
?>

Bob
Austre 14 Jun, 2017
Got this option too: put a Custom Javascript at Designer tab with the code below and checked the Add inside domready event option.

$.getScript('filepath/jquery.datatables.min.js', function(){
	$('#tableData').dataTable({});
});
GreyHead 15 Jun, 2017
Hi Austre,

Thank you - I've updated the FAQ to include both methods.

Bob
This topic is locked and no more replies can be posted.