Talk:Snippets/Style pages based on categories
Add topicAppearance
Latest comment: 8 years ago by Stefahn in topic Load JavaScript before CSS
| This page used the Structured Discussions extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
Load JavaScript before CSS
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Thanks for your snippet. It's very handy.
How can I add the snippet to a wiki page? If I try to do that, I get ReferenceError: jQuery is not defined
I can add the snippet to my Common.js. However the Common.js seems to be loaded only after the CSS files. So there is a short moment where you can see all the elements I want to disable in a certain category. I don't want the user to see these elements.
Thanks, Stefan Stefahn (talk) 14:13, 21 October 2017 (UTC)
- There's no other way to load it before the page is rendered than output the category classes directly by PHP, by implementing an extension or directly a hook in LocalSettings.php Ciencia Al Poder (talk) 14:56, 21 October 2017 (UTC)
- Okay, thanks.
- I (re)found the extension AddBodyClass which does exactly what I need. Stefahn (talk) 15:59, 21 October 2017 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.