diff --git a/src/modules/layer.js b/src/modules/layer.js index f6c1fb8d..61ff7598 100644 --- a/src/modules/layer.js +++ b/src/modules/layer.js @@ -11,8 +11,8 @@ var $; var win; var ready = { getPath: function(){ - var jsPath = document.currentScript ? document.currentScript.src : function(){ - var js = document.scripts; + var jsPath = (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') ? document.currentScript.src : function(){ + var js = document.getElementsByTagName('script'); var last = js.length - 1; var src; for(var i = last; i > 0; i--){