Code cleanup
This commit is contained in:
committed by
Robin North
parent
57aed828ac
commit
6fb509a021
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user