Running plugin if datatables exists
Running plugin if datatables exists
I add Datatables plugins inside my js files like this:
[code]$.fn.dataTableExt.oSort;[/code]
Sometimes I don't include datatables.js files in that pages.
But in that case I get this error :
[code]Uncaught TypeError: Cannot read property 'oSort' of undefined [/code]
How can I make this plugin loaded if datatables is active?
[code]$.fn.dataTableExt.oSort;[/code]
Sometimes I don't include datatables.js files in that pages.
But in that case I get this error :
[code]Uncaught TypeError: Cannot read property 'oSort' of undefined [/code]
How can I make this plugin loaded if datatables is active?
This discussion has been closed.
Replies
if ( $.fn.dataTable ) {
... plug-in code
}
[/code]
Allan