change owner

This commit is contained in:
afred 2024-12-11 13:10:55 +08:00
parent 1ba238e881
commit 1fadf4312c
1 changed files with 3 additions and 3 deletions

View File

@ -13,8 +13,8 @@ export default function HotjarLoader() {
h._hjSettings = { hjid: 3414362, hjsv: 6 }; h._hjSettings = { hjid: 3414362, hjsv: 6 };
// 获取 <head> 元素 // 获取 <head> 元素
a = o.getElementsByTagName("head")[0]; const headElement = o.getElementsByTagName("head")[0];
if (!a) { if (!headElement) {
console.error("Head element not found in the document."); console.error("Head element not found in the document.");
return; // 如果没有找到 <head>,直接退出 return; // 如果没有找到 <head>,直接退出
} }
@ -25,7 +25,7 @@ export default function HotjarLoader() {
r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv; r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv;
// 将 <script> 插入 <head> // 将 <script> 插入 <head>
a.appendChild(r); headElement.appendChild(r); // 使用明确的变量
})(window, document, "https://static.hotjar.com/c/hotjar-", ".js?sv="); })(window, document, "https://static.hotjar.com/c/hotjar-", ".js?sv=");
}, []); }, []);