From 2653849a3ed1d16ec36cf3733bac203761b964db Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Tue, 25 Apr 2017 12:39:58 +0800 Subject: [PATCH] fix(external-script): script attrs --- src/plugins/external-script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/external-script.js b/src/plugins/external-script.js index f27f7279a..43a8a893c 100644 --- a/src/plugins/external-script.js +++ b/src/plugins/external-script.js @@ -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)