0

is it possible to load JS and CSS files in JSF pages without mentioning them using <link> or <script>.

I want to dynamically load the css and js, so that I can avoid writing so much code.

4
  • jQuery has a getScript() method specifically to do this; you could read its source and use a similar technique. I believe it basically loads a .js file using AJAX and eval() it immediately. Commented Jun 1, 2016 at 16:37
  • That said, you'd definitely be writing MORE code by loading these files dynamically than if you simply linked to them in the JSF file. Commented Jun 1, 2016 at 16:41
  • Another related question: stackoverflow.com/q/8367421 Commented Jun 1, 2016 at 17:37
  • Thanks Blazemonger and BalusC. Commented May 11, 2017 at 11:00

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.