Skip to content

Commit fe9b28c

Browse files
committed
Fix setting attributes from html scripts
1 parent e4897f9 commit fe9b28c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/srcdoc/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ function loadRemoteScript(script) {
280280
el.async = el.defer = false
281281

282282
if (script.el)
283-
Array.prototype.slice.call(script.el.attributes).forEach(a => el[a.name] = a.value)
283+
Array.prototype.slice.call(script.el.attributes).forEach(a => el.setAttribute(a.name, a.value))
284284

285285
el.onload = () => resolve()
286286
el.onerror = err => reject([script.url, err])
@@ -324,7 +324,7 @@ window.flemsLoadScript = function flemsLoadScript(script) {
324324
el.async = el.defer = false
325325

326326
if (script.el)
327-
Array.prototype.slice.call(script.el.attributes).forEach(a => el[a.name] = a.value)
327+
Array.prototype.slice.call(script.el.attributes).forEach(a => el.setAttribute(a.name, a.value))
328328

329329
el.onerror = reject
330330
el.onload = resolve

0 commit comments

Comments
 (0)