I want to check if a table element with say, id=\"datatable\" is datatables-initialized. Something like this:
if ($(\'#datatable\').dataTable().initialized) {
I feel following is the right answer to this.
$(document).ready(function(){
if (jQuery().dataTable) {
// your code to do some detaul set ups
}
});
For example
$(document).ready(function(){
if (jQuery().dataTable) {
$.extend( $.fn.dataTable.defaults, {
iDisplayLength : 200,
aLengthMenu : [[100, 200, 300, -1], [100, 200, 300, "All"]],
});
}
});
By this way you if(jQuery().
should be able to check any library loaded or not.