Code cleanup

This commit is contained in:
Behind The Math
2018-01-29 23:20:00 -05:00
committed by Robin North
parent 57aed828ac
commit 6fb509a021
12 changed files with 25 additions and 27 deletions

View File

@@ -13,12 +13,12 @@ module.exports = function(el) {
script.type = "text/javascript"
if (src != "") {
if (src !== "") {
script.src = src;
script.async = false; // force synchronous loading of peripheral js
}
if (code != "") {
if (code !== "") {
try {
script.appendChild(document.createTextNode(code))
}
@@ -31,7 +31,7 @@ module.exports = function(el) {
// execute
parent.appendChild(script);
// avoid pollution only in head or body tags
if (["head","body"].indexOf(parent.tagName.toLowerCase()) > 0) {
if (["head", "body"].indexOf(parent.tagName.toLowerCase()) > 0) {
parent.removeChild(script)
}