I use this inside my scripts:
$.fn.dataTableExt.oSort['title-numeric-asc'] = function(a,b) {
var x = a.match(/title="*(-?[0-9\.]+)/)[1];
var y = b.match(/title="*(-?[0-9\.]+)/)[1];
x = parseFloat( x );
y = parseFloat( y );
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
};
datatableExt comes from this:
http://datatables.net/download/build/jquery.dataTables.js
Sometimes i include “jquery.dataTables.js” sometimes I don’t.
So I want to add this plugin if datatables code is included.
How can I check?
Is it something like (typeof fn.dataTableExt != 'undefined')
I think it’s as simple as