Merge pull request #2004 from tomalec/html-import-issue
Use current document to process <script> tags (fixes ajaxorg/ace#2003)
This commit is contained in:
commit
bdd54043b5
1 changed files with 5 additions and 1 deletions
|
|
@ -153,7 +153,11 @@ function init(packaged) {
|
|||
var scriptOptions = {};
|
||||
var scriptUrl = "";
|
||||
|
||||
var scripts = document.getElementsByTagName("script");
|
||||
// Use currentScript.ownerDocument in case this file was loaded from imported document. (HTML Imports)
|
||||
var currentScript = (document.currentScript || document._currentScript ); // native or polyfill
|
||||
var currentDocument = currentScript && currentScript.ownerDocument || document;
|
||||
|
||||
var scripts = currentDocument.getElementsByTagName("script");
|
||||
for (var i=0; i<scripts.length; i++) {
|
||||
var script = scripts[i];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue