Title: Loading Datables Assets only when needed
Last modified: August 30, 2016

---

# Loading Datables Assets only when needed

 *  Resolved [X-Raym](https://wordpress.org/support/users/x-raym/)
 * (@x-raym)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/loading-datables-assets-only-when-needed/)
 * Hi !
 * When I look at my website homepahe, I see that there is a lot of datables scripts
   and css stylesheet are loaded, even if there is not datables on this page.
    As
   most of my page doesn’t use tables, I think it would be better if the datatables
   assets were loaded only when needed (aka, only if the screenshot is detected 
   in the page).
 * Would it be possible to make an option for that ?
 * I could use [WordPress › Plugin Organizer « WordPress Plugins](https://wordpress.org/plugins/plugin-organizer/)
   but I think it would be nice if this behavior was the fedault behavior (as I 
   don’t see any reason to load this assets when not needed).
 * WHat do you think of that ?
 * Thanks for listening ! 🙂
 * [https://wordpress.org/plugins/inline-google-spreadsheet-viewer/](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Meitar](https://wordpress.org/support/users/meitar/)
 * (@meitar)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/loading-datables-assets-only-when-needed/#post-6637019)
 * I load the scripts unconditionally because tables not generated by the shortcode
   may also have the datatables styling applied. See the DataTables classes option
   in the setting screen.
 *  Thread Starter [X-Raym](https://wordpress.org/support/users/x-raym/)
 * (@x-raym)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/loading-datables-assets-only-when-needed/#post-6637027)
 * Ok, that makes sense.
    I guess having a way to filter the conent first in order
   to see of there is any tables with dataTables class (or shortcode) in the post
   may be a painful to integrate and may not be very good for performance, so using
   Plugin Organizer (or altetnative) sounds like the solution 😛
 * Thanks for the answer, and this great plugin !

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Loading Datables Assets only when needed’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/inline-google-spreadsheet-viewer.
   svg)
 * [Inline Google Spreadsheet Viewer](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/)
 * [Active Topics](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/reviews/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [loading](https://wordpress.org/support/topic-tag/loading/)

 * 2 replies
 * 2 participants
 * Last reply from: [X-Raym](https://wordpress.org/support/users/x-raym/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/loading-datables-assets-only-when-needed/#post-6637027)
 * Status: resolved