summaryrefslogtreecommitdiffstatshomepage
path: root/dist/htmx.js
diff options
context:
space:
mode:
Diffstat (limited to 'dist/htmx.js')
-rw-r--r--dist/htmx.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/dist/htmx.js b/dist/htmx.js
index 90190944..0e31707b 100644
--- a/dist/htmx.js
+++ b/dist/htmx.js
@@ -312,22 +312,23 @@ return (function () {
var fragment = parseHTML("<body><template>" + content + "</template></body>", 0);
// @ts-ignore type mismatch between DocumentFragment and Element.
// TODO: Are these close enough for htmx to use interchangeably?
+ var fragmentContent = fragment.querySelector('template').content;
if (htmx.config.allowScriptTags) {
// if there is a nonce set up, set it on the new script tags
- forEach(fragment.querySelectorAll("script"), function (script) {
+ forEach(fragmentContent.querySelectorAll("script"), function (script) {
if (htmx.config.inlineScriptNonce) {
script.nonce = htmx.config.inlineScriptNonce;
}
// mark as executed due to template insertion semantics on all browsers except firefox fml
- getInternalData(script).executed = navigator.userAgent.indexOf("Firefox") === -1;
+ script.htmxExecuted = navigator.userAgent.indexOf("Firefox") === -1;
})
} else {
- forEach(fragment.querySelectorAll("script"), function (script) {
+ forEach(fragmentContent.querySelectorAll("script"), function (script) {
// remove all script tags if scripts are disabled
removeElement(script);
})
}
- return fragment.querySelector('template').content;
+ return fragmentContent;
}
switch (startTag) {
case "thead":
@@ -1907,7 +1908,7 @@ return (function () {
}
function evalScript(script) {
- if (!getInternalData(script).executed && htmx.config.allowScriptTags &&
+ if (!script.htmxExecuted && htmx.config.allowScriptTags &&
(script.type === "text/javascript" || script.type === "module" || script.type === "") ) {
var newScript = getDocument().createElement("script");
forEach(script.attributes, function (attr) {