Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion dist/vue-script2.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@

load(src) {
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
parent: document.head
parent: document.head,
attributes: []
};

if (!Script2.loaded[src]) {
Expand All @@ -104,6 +105,12 @@
s.src = src; // crossorigin in HTML and crossOrigin in the DOM per HTML spec
// https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-crossorigin

if(opts.attributes.length > 0)
opts.attributes.forEach(element => {
s.setAttribute(element.key,element.value)
});


if (opts.crossorigin) {
s.crossOrigin = opts.crossorigin;
} // inspiration from: https://github.com/eldargab/load-script/blob/master/index.js
Expand Down
Loading