Buy Now
Sign in

Load JS File

Austre , June 14 2017, 12:58
Austre 86
June 14 2017, 12:58 #369396
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 64
June 14 2017, 15:53 #369410
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
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
Austre 86
June 14 2017, 17:00 #369414
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 64
June 15 2017, 09:47 #369439
Hi Austre,

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

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much