Permalink
Browse files

Accept a comma separated list of scripts in loader.html.

  • Loading branch information...
1 parent eee5ba7 commit 0127e411c6fc81322d0090018ea46f51e2f1a871 @deanm committed May 20, 2009
Showing with 10 additions and 3 deletions.
  1. +10 −3 demos/loader.html
View
@@ -25,9 +25,16 @@
<script src="demo_utils.js"></script>
<script>
window.addEventListener('load', function() {
- var script = document.createElement('script');
- script.src = document.location.hash.substr(1);
- document.body.appendChild(script);
+ var paths = document.location.hash.substr(1).split(',');
+ for (var i = 0, il = paths.length; i < il; ++i) {
+ var path = paths[i];
+ // Some sort of sad security attempt to not load external js.
+ if (path.indexOf(':') != -1)
+ continue;
+ var script = document.createElement('script');
+ script.src = path;
+ document.body.appendChild(script);
+ }
}, false);
</script>
</head>

0 comments on commit 0127e41

Please sign in to comment.