Thread:Extension talk:DataTables/How to use the ResourceLoader ?/reply

Hi Rabin,

From within an extension you should add  as a dependency to your ResourceLoader module (if you have one.) If you don't I suggest defining a new ResourceLoader module that will contain some JavaScript/CSS for your extension. It might look like this:

Once this is done, you can use the DataTables.net jQuery library as normal. In your JavaScript code, you can

I strongly suggest reading the DataTables.net documentation on http://datatables.net/.

If you would like to call DataTables from within a page, this is a little more involved. Since MediaWiki does not allow JavaScript within pages (for security reasons among other things,) you might want to look at Extension:Javascript. Calling DataTables from within a page would look something like this: