How to dynamically load JavaScript and CSS files
One of the requirements of the Opta Sports real-time Cricket widget (blog post | Opta Sports live cricket scores page) was that including the widget should be as simple as possible. One way to keep things simple is to only need to include one script tag which dynamically includes all required JavaScript and CSS files. We'd outsourced some of the widget development to Matador Digital and we passed this requirement on to them. They came up with a nifty bit of JavaScript that met exactly these requirements.
- Labjs
- RequireJS
- Using jQuery (obviously means jQuery has to be included normally)
Comments [0]