const scriptContainers = ["div", "iframe", "noframes", "noembed"];
for (var i = 0; i < scriptContainers.length; ++i) {
for (var func of scriptCreationFuncs) { var cont = scriptContainers[i]; var node = document.createElement(cont);
document.body.appendChild(node); var s = func();
s.setAttribute("type", "application/javascript");
s.appendChild(document.createTextNode('window["'+cont+'ScriptRan"] = true'));
window[cont+"ScriptRan"] = false;
node.appendChild(s);
is(window[cont+"ScriptRan"], true, "Script created with " + func +" should run when inserting in <"+cont+">");
window[cont+"ScriptRan"] = false;
document.body.appendChild(s);
is(window[cont+"ScriptRan"], false, "Script created with " + func + " shouldn't run when moving out of <"+cont+">");
window[cont+"ScriptRan"] = false;
document.body.appendChild(s.cloneNode(true));
is(window[cont+"ScriptRan"], false, "Clone of script inside <" + cont + "> created with " + func + " shouldn't run");
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.