Skip to content

Commit

Permalink
fix(external-script): script attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Apr 25, 2017
1 parent d7b0d1b commit 2653849
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/external-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ function handleExternalScript () {
if (script && script.src) {
const newScript = document.createElement('script')

;['src', 'async', 'defer'].forEach(attribute => {
newScript[attribute] = script[attribute]
Array.prototype.slice.call(script.attributes).forEach(attribute => {
newScript[attribute.name] = attribute.value
})

script.parentNode.insertBefore(newScript, script)
Expand Down

0 comments on commit 2653849

Please sign in to comment.