diff --git a/bs.html b/bs.html
new file mode 100644
index 0000000..9745acb
--- /dev/null
+++ b/bs.html
@@ -0,0 +1,33 @@
+
+
BasicScript demo
+Something important
+
+
+
+
+
diff --git a/index.js b/index.js
index 462e04b..2b0ec3a 100644
--- a/index.js
+++ b/index.js
@@ -1,5 +1,5 @@
-window.onload = function () {
+window.addEventListener('DOMContentLoaded', function () {
var $ = function (s) { return document.querySelector(s); };
@@ -240,4 +240,4 @@ window.onload = function () {
} else {
loadFile('samples/sample.default.txt', setSource);
}
-};
+});
diff --git a/script.js b/script.js
index 427b80c..ac9a813 100644
--- a/script.js
+++ b/script.js
@@ -141,7 +141,7 @@
}
window.addEventListener('load', function() {
- [].forEach.call(document.querySelectorAll('script'), function(script) {
+ [].forEach.call($$('script'), function(script) {
if (script.type === 'text/applesoft-basic') {
var elem = createInstance(script.innerText);
script.parentElement.insertBefore(elem, script.nextSibling);