fix path not defined

This commit is contained in:
Jonas Leder 2021-11-09 12:22:31 +01:00
parent be57ada3fa
commit e5541155bd

View file

@ -14,7 +14,7 @@ class newComment extends HTMLElement {
script.src = "https://hCaptcha.com/1/api.js";
script.type = 'text/javascript';
script.onload = () => {
let pageName = path.split("/").pop();
let pageName = window.location.pathname.split("/").pop();
this.parentElement.innerHTML = `
<form action="/API/newComment.php" method="post">
<label for="name">Name:</label><br>