I’ve recently recived a new computer, and transferred all files from the old one. Everything works fine EXCEPT one page, where the Script tag seems to be missing when I’m inspecting it in Chrome Dev-tools. It’s visible on the old computer when i inspect the page. Am i Missing something here?
Here is the page:
<?php
session_start();
if(isset($_SESSION['Loggedin']) && $_SESSION['Loggedin'] == true){
include './dbconn.php';
include './Icons.php';
$familyID = $_GET['ID'];
$sqlGetProductFamilies = "SELECT * FROM productfamily
INNER JOIN productowners ON productfamily.ProductOwnerID = productowners.ProductOwnerID
WHERE familyid= $familyID;";
$getAllProductFamilies = mysqli_query($conn,$sqlGetProductFamilies);
if(!$getAllProductFamilies){
echo'Execution failed: '.mysqli_error($conn).'';
}else{
while($PF = mysqli_fetch_assoc($getAllProductFamilies)){
$familyName = $PF['familyName'];
$ProductOwnerName = $PF['ProductOwnerName'];
}
}
$GetInformationOnProductFamily = "SELECT
PFSID,
standards.StandardName,
standards.StandardLink,
standards.StandardType,
productfamily.familyName,
productowners.ProductOwnerName,
productowners.ProductOwnerID
FROM productfamilystandards
INNER JOIN productfamily ON productfamilystandards.PFSFamilyID = productfamily.familyid
INNER JOIN standards ON productfamilystandards.PFSStandardID = standards.StandardID
INNER JOIN productowners ON productfamily.ProductOwnerID = productowners.ProductOwnerID
WHERE productfamilystandards.PFSFamilyID = $familyID;";
$ResultInformationOnProductFamily = mysqli_query($conn,$GetInformationOnProductFamily);
if($ResultInformationOnProductFamily){
while($info = mysqli_fetch_assoc($ResultInformationOnProductFamily)){
$StandardName = $info['StandardName'];
$StandardLink = $info['StandardLink'];
$StandardType = $info['StandardType'];
$FamilyName = $info['familyName'];
$ProductOwner = $info['ProductOwnerName'];
$ProductOwnerID = $info['ProductOwnerID'];
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo $familyName; ?> compliance</title>
<link rel="stylesheet" href="../CSS/style.css">
<link rel="apple-touch-icon" sizes="180x180" href="../Images/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" sizes="32x32" href="../Images/favicon.ico">
<link rel="icon" type="image/png" sizes="16x16" href="../Images/favicon.ico">
<link rel="manifest" href="/site.webmanifest">
</head>
<body>
<div class="logo-container">
<a href="http://localhost:81/minDB/Standards/PHP/ProductOverview.php"><img src="../Images/aura-light-international-ab-logo-vector-small.png" alt="Aura Light International AB Logo"></a>
</div>
<div class="productpage-image">
<img src="<?php echo '../Images/Products/'.$familyName.'.png';?>" alt="<?php echo $familyName?>">
<h2><?php echo $familyName ?></h2>
<?php
if(empty($ProductOwnerName)){
echo '<h3 id="POName">No owner assigned, please do so</h3>';
}else{
echo '<h3 id="POName">Product Owner: '.$ProductOwnerName.'</h3>';
}
?>
<button id="EditPO" onclick="toggleEditPO()" class="knapp hidden">Edit PO</button>
<!-- och teamslänk kanske? -->
</div>
<!-- I divven under ska all information finnas på produkten -->
<div class="windowforlists">
<div class="listOfStandards">
<!--Här genereras listan över alla registrerade LVD-standarder -->
<label for="LVD">LVD Standards</label>
<?php if($_SESSION['Admin']== true){?>
<div>
<button id="editLVD" class="knapp-text">Edit</button>
<button onclick="toggleAddNewLVD()" class="knapp-text hidden" id="addLVD">Add LVD</button>
</div>
<?php } ?>
<ul name="LVD" id="LVD">
<?php
$GetAllLVDForFamily = "SELECT PFSStandardID, PFSID, StandardName, StandardType FROM productfamilystandards
INNER JOIN standards ON productfamilystandards.PFSStandardID = standards.StandardID
WHERE PFSFamilyID = $familyID AND StandardType = 'LVD';";
$ResultofLVD = mysqli_query($conn, $GetAllLVDForFamily);
if($ResultofLVD){
while($LVD = mysqli_fetch_assoc($ResultofLVD)){
$StandardName = $LVD['StandardName'];
$StandardType = $LVD['StandardType'];
$PFSID = $LVD['PFSID'];
$PFSStandardID = $LVD['PFSStandardID'];
echo '
<li>
<a href="./DeleteStandardOnFamily.php?PFSID='.$PFSID.'&ID='.$familyID.'">
<img class="knapp-röd addAmendmentLVD hidden" src="'.$delete_icon.'">
</a>';
echo'<h3>'.$StandardName.' </h3>';
$getallAmendmentsOnStandard = "SELECT * FROM standardamendments WHERE amendmentParentID = $PFSStandardID;";
$resultgetallAmendmentsOnStandard = mysqli_query($conn, $getallAmendmentsOnStandard);
if(mysqli_num_rows($resultgetallAmendmentsOnStandard) > 0){
echo '
<a href="./addAmendmentOnProductStandard.php?PFSStandardID='.$PFSStandardID.'&familyID='.$familyID.'">
<img class="knapp-neutral addAmendmentLVD hidden" src="'.$Fact_icon.'">
</a>';
}
//Här hämtar jag även om det finns några tillägg till standarden
$SQLGetAmendments = "SELECT productfamilystandards.PFSAmendments, standardamendments.amendmentName FROM productfamilystandards
INNER JOIN standardamendments ON standardamendments.amendmentID = productfamilystandards.PFSAmendments
WHERE PFSStandardID = $PFSStandardID AND PFSFamilyID = $familyID;";
$GETAllAmendments = mysqli_query($conn, $SQLGetAmendments);
if(mysqli_num_rows($GETAllAmendments)> 0){
while($Amendments = mysqli_fetch_assoc($GETAllAmendments)){
$amendmentName = $Amendments['PFSAmendments'];
$amendmentsArray = explode(",", $amendmentName);
foreach($amendmentsArray as $amendmentID){
$getAmendmentName ="SELECT amendmentName FROM standardamendments WHERE amendmentID = $amendmentID;";
$resultgetAmendmentName = mysqli_query($conn, $getAmendmentName);
if(!$resultgetAmendmentName){
mysqli_error($conn);
exit();
}else{
while($row = mysqli_fetch_assoc($resultgetAmendmentName)){
$AName = $row['amendmentName'];
echo '<p> + '.$AName.'</p>';
}
}
}
}
}else{
echo'</li>';
}
}
}
?>
</ul>
<!--Här genereras listan över alla registrerade EMC-standarder -->
<label for="EMC">EMC Standards</label>
<?php if($_SESSION['Admin'] == true){?>
<div>
<button id="editEMC" class="knapp-text">Edit</button>
<button onclick="toggleAddNewEMC()" id="addEMC" class="knapp-text hidden">Add EMC</button>
</div>
<?php }?>
<ul name="EMC" id="EMC">
<?php
$GetAllEMCForFamily = "SELECT PFSStandardID, PFSID, StandardName, StandardType FROM productfamilystandards
INNER JOIN standards ON productfamilystandards.PFSStandardID = standards.StandardID
WHERE PFSFamilyID = $familyID AND StandardType = 'EMC'";
$ResultofEMC = mysqli_query($conn, $GetAllEMCForFamily);
if($ResultofEMC){
while($EMC = mysqli_fetch_assoc($ResultofEMC)){
$StandardName = $EMC['StandardName'];
$StandardType = $EMC['StandardType'];
$PFSID = $EMC['PFSID'];
$PFSStandardID = $EMC['PFSStandardID'];
echo '
<li>
<a href="./DeleteStandardOnFamily.php?PFSID='.$PFSID.'&ID='.$familyID.'">
<img class="knapp-röd addAmendmentEMC hidden" src="'.$delete_icon.'">
</a>';
echo'<h3>'.$StandardName.'</h3>';
$getallAmendmentsOnStandard = "SELECT * FROM standardamendments WHERE amendmentParentID = $PFSStandardID;";
$resultgetallAmendmentsOnStandard = mysqli_query($conn, $getallAmendmentsOnStandard);
if(mysqli_num_rows($resultgetallAmendmentsOnStandard) > 0){
echo '
<a href="./addAmendmentOnProductStandard.php?PFSStandardID='.$PFSStandardID.'&familyID='.$familyID.'">
<img class="knapp-neutral addAmendmentEMC hidden" src="'.$Fact_icon.'">
</a>';
}
$SQLGetAmendments = "SELECT productfamilystandards.PFSAmendments, standardamendments.amendmentName FROM productfamilystandards
INNER JOIN standardamendments ON standardamendments.amendmentID = productfamilystandards.PFSAmendments
WHERE PFSStandardID = $PFSStandardID AND PFSFamilyID = $familyID;";
$GETAllAmendments = mysqli_query($conn, $SQLGetAmendments);
if(mysqli_num_rows($GETAllAmendments)> 0){
while($Amendments = mysqli_fetch_assoc($GETAllAmendments)){
$amendmentName = $Amendments['PFSAmendments'];
$amendmentsArray = explode(",", $amendmentName);
foreach($amendmentsArray as $amendmentID){
$getAmendmentName ="SELECT amendmentName FROM standardamendments WHERE amendmentID = $amendmentID;";
$resultgetAmendmentName = mysqli_query($conn, $getAmendmentName);
if(!$resultgetAmendmentName){
mysqli_error($conn);
exit();
}else{
while($row = mysqli_fetch_assoc($resultgetAmendmentName)){
$AName = $row['amendmentName'];
echo '<p> + '.$AName.'</p>';
}
}
}
}
}else{
echo'</li>';
}
}
}
?>
</ul>
</div>
<!-- Här är allt för mitten delen (Certificate/Report) -->
<div class="listInWindow">
<div>
<?php
if($_SESSION['CanSignCE'] == true){
?>
<a href="./generateCE.php?familyID=<?php echo $familyID ?>"><button class="knapp-text">Generate CE</button></a><br>
<?php } ?>
<?php
if($_SESSION['Admin'] == true){
?>
<button id="btnNewDoc" class="knapp-text">Add Certificate/Report</button><br>
<?php } ?>
<?php
$filequery ="SELECT * FROM files WHERE fileCEFamilyID = $familyID";
$fileResult = mysqli_query($conn, $filequery);
if($fileResult && mysqli_num_rows($fileResult) > 0){?>
<form action="" method="GET">
<table class="tabell-CE">
<thead>
<tr>
<th>Filename</th>
<th>Operations</th>
</tr>
</thead>
<tbody>
<?php
while($row = mysqli_fetch_assoc($fileResult)){
$name = $row['fileName'];
$fileID = $row['fileID'];
echo '
<tr>
<td><legend>'.$name.'</legend></td>
<td>
<a title="Download document" href="../files/Compliance/'.$name.'"><img class="knapp" src="'.$download_icon.'"></a>';
if($_SESSION['Admin'] == true){
echo'<a title="Delete document from component" href="./deletedoc.php?fileID='.$fileID.'&ID='.$familyID.'"><img class="knapp-röd" src="'.$delete_icon.'"></a>';
}echo '
</td>
</tr>';
}
}else{
echo'
<tr>
<td>No documents attached to the family of '.$familyName.'</td>
<td></td>
</tr>';
}
?>
</tbody>
</table>
</form>
<!-- Här är fönstret för att lägga till ny rapport eller certifikat -->
<div id="addNewDocumentationOnFamily" class="fönster-look popup hidden">
<form action="" method="post" enctype="multipart/form-data">
<div class="">
<legend>Select file to Upload</legend>
<input type="file" name="file1"><br>
<input hidden type="number" name="family" value="<?php echo $familyID ?>">
<div>
<button type="submit" name="uploadCompliance" style="background:transparent;border:none;"><img class="knapp" src="../Images/Icons/file_upload_FILL0_wght100_GRAD0_opsz40.png"></button>
</div>
<h5>Ladda upp en fil i formaten .zip, .pdf eller .png</h5>
<h5>Filen får inte vara större än 10 Mb</h5>
</div>
</form>
<?php
if(isset($_POST['uploadCompliance'])){
$filename = $_FILES['file1']['name'];
$destination = "../files/Compliance/$filename";
$extension = pathinfo($filename, PATHINFO_EXTENSION);
$file = $_FILES['file1']['tmp_name'];
$size = $_FILES['file1']['size'];
$family = $_POST['family'];
if(!in_array($extension, ['zip', 'pdf', 'png', 'xls', 'jpeg', 'jpg'])){
echo "Du kan bara ladda upp .ZIP, .PDF, .PNG eller .XLS-filer till databasen";
}elseif($size > 10000000){
echo "Filen är för stor, den kan vara max 10 Mb.";
}else{
if(move_uploaded_file($file, $destination)){
$sql = "INSERT INTO files(fileName, fileCEFamilyID) VALUES ('$filename', '$family');";
if(mysqli_query($conn, $sql)){
//echo "Det gick ju galant";
echo"<script> window.location.href = './Productpage.php?ID=$family';</script>";
//header('location: ./uploads.php?compID='.$_GET['compID'].'&mainID='.$mainID.'');
exit;
} else{
echo "Det sket sig $conn->error";
}
}
}
}
?>
</div>
</div>
</div>
<!-- Här är allt för övrig data, högra fältet (Documents) -->
<div class="listInWindow">
<div>
<?php
if($_SESSION['Admin'] == true){?>
<button id="btnNewData" class="knapp-text">Add new document</button><br>
<?php
}
?>
<?php
$filequery ="SELECT * FROM files WHERE fileDataFamilyID = $familyID";
$fileResult = mysqli_query($conn, $filequery);
if($fileResult && mysqli_num_rows($fileResult) > 0){?>
<form method="GET">
<table class="tabell-CE">
<tr>
<th>Filnamn</th>
<th>Ladda ner</th>
</tr>
<?php
while($row = mysqli_fetch_assoc($fileResult)){
$name = $row['fileName'];
$fileID = $row['fileID'];
echo '
<tr>
<td><legend>'.$name.'</legend></td>
<td>
<a title="Download document" href="../files/Datasheets/'.$name.'"><img class="knapp" src="'.$download_icon.'"></a>';
if($_SESSION['Admin'] == true){
echo'<a title="Delete document from component" href="./deletedoc.php?fileID='.$fileID.'&ID='.$familyID.'"><img class="knapp-röd" src="'.$delete_icon.'"></a>';
}echo '
</td>
</tr>';
}
}else{
echo'No documents attached to the family of '.$familyName.'';
}
?>
</table>
</form>
<!-- Här är fönstret för att lägga till övrig dokumentation -->
<div id="addNewDataOnFamily" class="fönster-look popup hidden">
<form action="" method="post" enctype="multipart/form-data">
<div class="">
<legend>Select file to Upload</legend>
<input type="file" name="file1"><br>
<input hidden type="number" name="family" value="<?php echo $familyID ?>">
<div>
<button type="submit" name="uploadData" style="background:transparent;border:none;"><img class="knapp" src="../Images/Icons/file_upload_FILL0_wght100_GRAD0_opsz40.png"></button>
</div>
<h5>Ladda upp en fil i formaten .zip, .pdf eller .png</h5>
<h5>Filen får inte vara större än 10 Mb</h5>
</div>
</form>
<?php
if(isset($_POST['uploadData'])){
$filename = $_FILES['file1']['name'];
$destination = "../files/Datasheets/$filename";
$extension = pathinfo($filename, PATHINFO_EXTENSION);
$file = $_FILES['file1']['tmp_name'];
$size = $_FILES['file1']['size'];
$family = $_POST['family'];
if(!in_array($extension, ['zip', 'pdf', 'png', 'xls', 'jpeg', 'jpg'])){
echo "Du kan bara ladda upp .ZIP, .PDF, .PNG eller .XLS-filer till databasen";
}elseif($size > 10000000){
echo "Filen är för stor, den kan vara max 10 Mb.";
}else{
if(move_uploaded_file($file, $destination)){
$sql = "INSERT INTO files('fileName', 'fileDataFamilyID') VALUES ('$filename', '$family');";
if(mysqli_query($conn, $sql)){
//echo "Det gick ju galant";
echo"<script> window.location.href = './Productpage.php?ID=$family';</script>";
//header('location: ./uploads.php?compID='.$_GET['compID'].'&mainID='.$mainID.'');
exit;
} else{
echo "Det sket sig $conn->error";
}
}
}
}
?>
</div>
</div>
</div>
<!-- Här är fönstret för att lägga till ny LVD-standard -->
<div id="addNewLVD" class="fönster-look popup hidden">
<button onclick="toggleAddNewLVD()" class="knapp-röd">X</button>
<form action="" method="post">
<select name="addLVD" id="">
<?php
$GetAllLVDStandards = 'SELECT * FROM standards WHERE StandardType LIKE "LVD%";';
$resultOfGetAllLVDStandards = mysqli_query($conn, $GetAllLVDStandards);
if($resultOfGetAllLVDStandards){
while($std = mysqli_fetch_assoc($resultOfGetAllLVDStandards)){
$StandardName = $std['StandardName'];
$StandardID = $std['StandardID'];
$StandardDateOfEffect = $std['StandardDateOfEffect'];
$StandardDateOfWithdrawal = $std['StandardDateOfWithdrawal'];
$StandardDesc = $std['StandardDescription'];
echo'
<option value="'.$StandardID.'">'.$StandardName.'</option>';
}
}
?>
</select><br>
<button type="submit" class="knapp-text" name="addLVDStd">Add to <?php echo $familyName ?></button>
</form>
<?php
if(isset($_POST['addLVDStd'])){
$selectedStd = $_POST['addLVD'];
$addLVDToFamily = "INSERT INTO productfamilystandards (PFSFamilyID, PFSStandardID) VALUES ('$familyID', '$selectedStd');";
if(mysqli_query($conn, $addLVDToFamily)){
echo "<script>alert('Standard is now added to ".$familyName."'); window.location.href='./productpage.php?ID=".$familyID."';</script>";
}else{
echo "<script>alert(Execution failed: ".mysqli_error($conn).")</script>";
}
}
?>
</div>
<!--Här är fönstret som lägger till ny EMC-standard -->
<div id="addNewEMC"class="fönster-look popup hidden">
<button onclick="toggleAddNewEMC()" class="knapp-röd">X</button>
<form action="" method="post">
<select name="addEMC" id="">
<?php
$GetAllEMCStandards = 'SELECT * FROM standards WHERE StandardType LIKE "EMC%";';
$resultOfGetAllEMCStandards = mysqli_query($conn, $GetAllEMCStandards);
if($resultOfGetAllEMCStandards){
while($std = mysqli_fetch_assoc($resultOfGetAllEMCStandards)){
$StandardName = $std['StandardName'];
$StandardID = $std['StandardID'];
$StandardDateOfEffect = $std['StandardDateOplaceholderfEffect'];
$StandardDateOfWithdrawal = $std['StandardDateOfWithdrawal'];
$StandardDesc = $std['StandardDescription'];
echo'
<option value="'.$StandardID.'">'.$StandardName.'</option>';
}
}
?>
</select>
<button type="submit" name="addEMCStd">Add to <?php echo $familyName ?></button>
</form>
<?php
if(isset($_POST['addEMCStd'])){
$selectedStd = $_POST['addEMC'];
$addEMCToFamily = "INSERT INTO productfamilystandards (PFSFamilyID, PFSStandardID) VALUES ('$familyID', '$selectedStd');";
if(mysqli_query($conn, $addEMCToFamily)){
echo "<script>alert('Standard is now added to ".$familyName."'); window.location.href='./productpage.php?ID=".$familyID."';</script>";
}else{
echo "<script>alert(Execution failed: ".mysqli_error($conn).")</script>";
}
}
?>
</div>
<!-- Här är fönstret som lägger till Produkt ägare -->
<div id="AddPO" class="fönster-look popup-flex hidden">
<form method="POST">
<select name="PO">
<?php
$getallPO = "SELECT * FROM productowners;";
$resultgetallPO = mysqli_query($conn, $getallPO);
if($resultgetallPO){
while($PO = mysqli_fetch_assoc($resultgetallPO)){
$ProductOwnerNameSelect = $PO['ProductOwnerName'];
$ProductOwnerIDSelect =$PO['ProductOwnerID'];
$ProductOwnerEmailSelect =$PO['ProductOwnerEmail'];
echo '<option value='.$ProductOwnerIDSelect.'>'.$ProductOwnerNameSelect.'</option>';
}
}
?>
</select>
<button type="submit" name="submitPO" class="knapp">Update</button>
</form>
<?php
if(isset($_POST['submitPO'])){
$ProductOwnerIDUpdate = $_POST['PO'];
$sendupdate = "UPDATE productfamily SET ProductOwnerID = $ProductOwnerIDUpdate WHERE familyid = $familyID;";
$resultofupdatePO = mysqli_query($conn, $sendupdate);
if($resultofupdatePO){
echo '<script>alert("Product owner has now been updated");window.location.href="./Productpage.php?ID='.$familyID.'";</script>';
}
mysqli_error($conn);
}
?>
</div>
<!-- Här lägger adderar man tillägg på standarder -->
<div id="AddAmendment" class="fönster-look popup-flex hidden">
<form method="POST">
<?php
$SQLGetAmendments = "SELECT * FROM standardamendments WHERE amendmentParentID = ;";
$GETAllAmendments = mysqli_query($conn, $SQLGetAmendments);
if(mysqli_num_rows($GETAllAmendments)> 0){
while($Amendments = mysqli_fetch_assoc($GETAllAmendments)){
$amendmentName = $Amendments['amendmentName'];
$amendmentID = $Amendments['amendmentID'];
echo'<input type="checkbox" name="amendment[] "value="'.$amendmentID.'">'.$amendmentName.'</input><br>';
}
}
?>
<button type="submit" name="addAmendment" class="knapp">Update</button>
</form>
<?php
if(isset($_POST['addAmendment'])){
if(!empty($_POST['amendment'])){
foreach($_POST['amendment'] as $amendment)
echo $amendment;
}
}
?>
</div>
<script src="../JavaScript/script.js"></script>
<?php
}else{
header('Location: http://localhost:81/minDB/Startpage/PHP/login.php');
exit();
}?>
</body>
</html>
Here is the script.file:
function toggleAddFamily(){
document.querySelector("#mainwindow").classList.toggle("blur");
document.querySelector("#addFamily").classList.toggle("hidden");
}
function toggleAddNewStandard(){
document.querySelector("#addNewStandard").classList.toggle("hidden");
document.querySelector("#mainwindow").classList.toggle("blur");
}
function toggleAddNewAmendment(){
document.querySelector("#addNewAmendment").classList.toggle("hidden");
document.querySelector("#mainwindow").classList.toggle("blur");
}
function toggleAddNewLVD(){
document.querySelector("#addNewLVD").classList.toggle("hidden")
}
function toggleAddNewEMC(){
document.querySelector("#addNewEMC").classList.toggle("hidden")
}
document.querySelector("#editEMC").addEventListener("click",() => {
document.querySelector("#addEMC").classList.toggle("hidden");
if(document.querySelector("#addEMC").classList.contains("hidden")){
document.querySelector("#editEMC").innerText = "Edit";
}else{
document.querySelector("#editEMC").innerText = "Close edit";
}
document.querySelectorAll("li").forEach(function(el){
el.querySelectorAll(".addAmendmentEMC").forEach(function(btn) {
btn.classList.toggle("hidden");
})
})
})
document.querySelector("#editLVD").addEventListener("click",() => {
document.querySelector("#addLVD").classList.toggle("hidden");
if(document.querySelector("#addLVD").classList.contains("hidden")){
document.querySelector("#editLVD").innerText = "Edit";
document.querySelector("#editLVD").style.scale = "1";
}else{
document.querySelector("#editLVD").innerText = "Close edit";
}
document.querySelectorAll("li").forEach(function(el){
el.querySelectorAll(".addAmendmentLVD").forEach(function(btn) {
btn.classList.toggle("hidden");
})
// el.querySelectorAll(".addAmendmentLVD").forEach(function(btn) {
// btn.classList.toggle("hidden");
// })
})
})
function toggleEditPO(){
document.querySelector("#AddPO").classList.toggle("hidden")
}
document.querySelector("#POName").addEventListener("click", function(){
document.querySelector("#EditPO").classList.toggle("hidden")
})
document.querySelector('#btnNewDoc').addEventListener("click", function(){
document.querySelector("#addNewDocumentationOnFamily").classList.toggle("hidden")
})
document.querySelector('#btnNewData').addEventListener('click', function(){
document.querySelector('#addNewDataOnFamily').classList.toggle('hidden');
})
function toggleAddAmendment(){
document.querySelector("#AddAmendment").classList.toggle("hidden")
}
Note that everything works perfect on my old computer.
PLEASE HELP! I’m going crazy.
I’ve placed the script at the bottom of the page, where it doesn’t render.
I’ve placed it at the head-tag, where it DOES get rendered, but pointless since the targets of the DOM is below the tag.
I’ve made hard copys from the old computer and replaced the file in the new computer with the file from the old.