diff --git a/klib/load_script.js b/klib/load_script.js new file mode 100644 index 0000000..681f668 --- /dev/null +++ b/klib/load_script.js @@ -0,0 +1,16 @@ +//from http://stackoverflow.com/questions/950087/how-to-include-a-javascript-file-in-another-javascript-file +var loadScript = function(url, callback) { + // Adding the script tag to the head as suggested before + var head = document.getElementsByTagName('head')[0]; + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.src = url; + + // Then bind the event to the callback function. + // There are several events for cross browser compatibility. + script.onreadystatechange = callback; + script.onload = callback; + + // Fire the loading + head.appendChild(script); +}; \ No newline at end of file diff --git a/kubos_boxes.html b/kubos_boxes.html index cf23b81..fc66e03 100644 --- a/kubos_boxes.html +++ b/kubos_boxes.html @@ -7,28 +7,12 @@ +