dataTables loads slow with requireJS
dataTables loads slow with requireJS
When I use requireJS to load dataTables I see the unprocessed html for a short moment. Maybe because it waits for the DOM to be loaded ?
How can I load dataTables faster with requireJS ?
This is the main file
require.config({
paths: {
'jquery': 'libs/jQuery-2-0-3',
'datatables-plugin': 'plugins/jquery-datatables'
}
});
require(['jquery','datatables-plugin'],
function($) {
'use strict';
$(document).ready(function() {
$('.tablesorter-js').dataTable();
});
});
And the html in the head tag.
How can I load dataTables faster with requireJS ?
This is the main file
require.config({
paths: {
'jquery': 'libs/jQuery-2-0-3',
'datatables-plugin': 'plugins/jquery-datatables'
}
});
require(['jquery','datatables-plugin'],
function($) {
'use strict';
$(document).ready(function() {
$('.tablesorter-js').dataTable();
});
});
And the html in the head tag.
This discussion has been closed.
Replies
and end of body tag
$('.tablesorter-js').dataTable();
Allan
require(['jquery','datatables-plugin'],
to
define(['jquery','datatables-plugin'],
Removed the
$(document).ready(function() {
And positioned the
At the end of the body tag.