Skip to content

Commit

Permalink
Make loader work without currentScript.
Browse files Browse the repository at this point in the history
Change-Id: Iae203d82648496465c61d4e97c203ec445e3d1da
  • Loading branch information
joeyparrish committed Apr 21, 2015
1 parent 812e1de commit 5a8a98f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion load.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
(function() { // anonymous namespace
// The sources may be in a different folder from the test app.
// Compute the base URL for all library sources.
var loaderSrc = document.currentScript.src;
var currentScript = document.currentScript ||
document.scripts[document.scripts.length - 1];
var loaderSrc = currentScript.src;
var baseUrl = loaderSrc.split('/').slice(0, -1).join('/') + '/';

function loadScript(src) {
Expand Down

0 comments on commit 5a8a98f

Please sign in to comment.