From e0855cce657f48f8b2550d573b29f8a5bac58324 Mon Sep 17 00:00:00 2001 From: Max Baumann Date: Sun, 18 Jan 2015 17:04:54 -0800 Subject: [PATCH] remove script from parentNode since $document.body may have changed --- mithril.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mithril.js b/mithril.js index ddd94405..dc19c2f9 100644 --- a/mithril.js +++ b/mithril.js @@ -874,7 +874,7 @@ var m = (function app(window, undefined) { var script = $document.createElement("script"); window[callbackKey] = function(resp) { - $document.body.removeChild(script); + script.parentNode.removeChild(script); options.onload({ type: "load", target: { @@ -885,7 +885,7 @@ var m = (function app(window, undefined) { }; script.onerror = function(e) { - $document.body.removeChild(script); + script.parentNode.removeChild(script); options.onerror({ type: "error",