Systematic Architecture [EN]
The blog on systems development/architecture, to be a beautiful, artistic one.
Thursday, 3 September 2015
How to dynamically include js on the browser
```javascript ``` <pre class="prettyprint"> include = function (url, fn) { var e = document.createElement("script"); e.onload = fn; e.src = url; e.async=true; document.getElementsByTagName("head")[0].appendChild(e); } include("https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js",function(){ console.log("loaded!") }) include("https://code.jquery.com/jquery-2.1.4.min.js",function(){ console.log("loaded!") }) </pre>
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)