I put my script references in the <head> of the topic:
Code: Select all
<head>
<link rel="stylesheet" type="text/css" href="Resources/AvaPlugin/DataTables/css/jquery.dataTables.min.css" />
<script type="text/javascript" src="Resources/AvaPlugin/DataTables/js/jquery-3.3.1.min.js">
</script>
<script type="text/javascript" src="Resources/AvaPlugin/DataTables/js/jquery.dataTables.min.js">
</script>
<script type="text/javascript" src="Resources/AvaPlugin/DataTables/js/moment.min.js">
</script>
<script type="text/javascript" src="Resources/AvaPlugin/DataTables/js/datetime-moment.min.js">
</script>
</head>
I include the script that initialises the datatable just before the </body> tag at the end of the topic:
Code: Select all
<script type="text/javascript">
$(document).ready(function() {
$.noConflict();
$.fn.dataTable.moment( 'DD/MM/YYYY' );
$('table.display').DataTable( {
"order": [[ 0, "desc" ]],
"language": {
"search": "Filter:"
}
} );
} );
</script>
Code: Select all
<link href="Resources/AvaPlugin/DataTables/css/jquery.dataTables.min.css" rel="stylesheet" />
<script src="Resources/AvaPlugin/DataTables/js/jquery-3.3.1.min.js">
</script>
<script src="Resources/AvaPlugin/DataTables/js/jquery.dataTables.min.js">
</script>
<script src="Resources/AvaPlugin/DataTables/js/moment.min.js">
</script>
<script src="Resources/AvaPlugin/DataTables/js/datetime-moment.min.js">
[*]Flare fails to include the referenced script files in the output
[*]Flare's reference to its internal version of jQuery appears above my script references in the source of the output topic (maybe causing the browser to ignore my scripts below)
[*]DataTables doesn't do its magic.
I suspect there's a conflict with Flare's internal version of jQuery, that it spits out into the Resources/Scripts folder in the output: jquery.min.js
These forum posts suggest using require.js:
viewtopic.php?f=9&t=19291
viewtopic.php?f=13&t=27117
I haven't had any luck with that method. I'm pretty new to JavaScript in general.
[*]Has anyone got DataTables or similar .js plugins working recently, preferably by referring to it in a masterpage?
[*]Do you have any suggestions on what I might be doing wrong?
[*]How do I refer to Flare's internal version of jQuery. This seems preferable.
[*]Can anyone explain how to use require.js with Flare in simple terms? I haven't got far with the documentation: https://requirejs.org/