How to add javascript color to css

Sorry, I couldn’t find a suitable title for this topic.

https://codepen.io/Koray-Gen-/pen/VYemZwG

I have a script ready and it works fine. What I want to do is add a color switcher to the site and change the background canvas color. I change the code below and add the necessary css tags, but when I click, only the color changes and the sliding canvas in the background does not appear. What am I doing wrong?

enter image description here

<h3 class="text-white">Color Switcher</h3>
<li class="purple" onclick="draw('purple')"data-bs-toggle="tooltip" data-path="css/color-purple.css"></li>

Weird white section behind ios26 searchbar i want it gone

I want the website to fullscreen on iOS 26 so there’s no background behind de search bar so it’s floating over the website like the foto from appleparts.nl the other is mine.

I want that the searchbar is transparent. I did try to make the color transparent but it didn’t work.

If I’m on the top of the page there’s nothing but if I scroll and the navbar goes away it comes

[website where the bar is under the searchbar]

image where it isnt this is what i want

this is the code of the navbar i thought it was the theme color but it inst i dont know how i get the section behind

<!DOCTYPE html>
<html lang="nl">
<head>
    <meta charset="UTF-8" />

    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
    <title>Bart Fiddelaers Bouwwerken</title>
    <meta name="theme-color" content="transparent">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <link rel="stylesheet" href="assets/index.css" />
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap" rel="stylesheet">
</head>

<body>
<button id="scrollTopBtn" title="Terug naar boven">↑</button>

<header class="navbar">
    <div class="container">
        <!-- Hamburger rechts -->
        <button class="menu" id="hamburger" aria-label="Main Menu" aria-expanded="false">
            <svg width="40" height="40" viewBox="0 0 100 100">
                <path class="line line1"
                      d="M 20,29.000046 H 80.000231 C 80.000231,29.000046 94.498839,28.817352 94.532987,66.711331
            94.543142,77.980673 90.966081,81.670246 85.259173,81.668997
            79.552261,81.667751 75.000211,74.999942 75.000211,74.999942
            L 25.000021,25.000058" />
                <path class="line line2" d="M 20,50 H 80" />
                <path class="line line3"
                      d="M 20,70.999954 H 80.000231 C 80.000231,70.999954 94.498839,71.182648 94.532987,33.288669
            94.543142,22.019327 90.966081,18.329754 85.259173,18.331003
            79.552261,18.332249 75.000211,25.000058 75.000211,25.000058
            L 25.000021,74.999942" />
            </svg>
        </button>

        <!-- Logo gecentreerd -->
        <div class="logo-wrapper">
            <img class="logo" src="assets/logobf.png" alt="Logo">
        </div>

        <!-- Desktop navigatie -->
        <div class="nav-wrapper">
            <nav class="nav-links">
                <a href="index.html" data-index="0" class="active">Home</a>
                <a href="overons.html" data-index="1">Over ons</a>
                <a href="Diensten.html" data-index="2">Diensten</a>
                <a href="realisatie.html" data-index="3">Realisaties</a>
                <a href="#contact" data-index="4">Contact</a>
            </nav>
            <div class="ruler-container">
                <div class="ruler" id="ruler"></div>
                <div class="indicator" id="indicator"></div>
            </div>
        </div>
    </div>


    <!-- Mobiel menu buiten .container -->
    <nav class="mobile-menu" id="mobileMenu">
        <a href="index.html" data-index="0" class="active">Home</a>
        <a href="overons.html" data-index="1">Over ons</a>
        <a href="Diensten.html" data-index="2">Diensten</a>
        <a href="realisatie.html" data-index="3">Realisaties</a>
        <a href="#contact" data-index="4">Contact</a>
    </nav>
</header>
</pre>
const ruler = document.getElementById('ruler');
const indicator = document.getElementById('indicator');

// Genereer ticks zoals bij een meetlat (elke 10e langer)
const totalTicks = 150;
for (let i = 0; i < totalTicks; i++) {
    const tick = document.createElement('div');
    tick.classList.add('tick');
    if (i % 10 === 0) tick.classList.add('long');
    ruler.appendChild(tick);
}

let activeIndex = 0;

function moveTo(index) {
    const link = links[index];
    const linkRect = link.getBoundingClientRect();
    const parentRect = link.parentElement.getBoundingClientRect();

    const centerOffset = linkRect.left - parentRect.left + linkRect.width / 2;

    ruler.style.transform = `translateX(${centerOffset - ruler.offsetWidth / 2}px)`;
    indicator.style.left = `${centerOffset}px`;

    links.forEach(a => a.classList.remove('active'));
    link.classList.add('active');
}

// Hover functionaliteit
links.forEach((link, index) => {
    link.addEventListener('mouseenter', () => moveTo(index));
    link.addEventListener('click', () => {
        activeIndex = index;
        moveTo(index);
    });
});

document.querySelector('.nav-links').addEventListener('mouseleave', () => {
    moveTo(activeIndex);
});

// Init bij laden van pagina
window.addEventListener('load', () => {
    const path = window.location.pathname;

    links.forEach((link, index) => {
        const href = link.getAttribute('href');
        if (path.endsWith(href)) activeIndex = index;
    });

    moveTo(activeIndex);
});

// Hamburger & mobiel menu
const hamburger = document.getElementById('hamburger');
const mobileMenu = document.getElementById('mobileMenu');
const mobileLinks = mobileMenu.querySelectorAll('a');
const desktopLinks = document.querySelectorAll('.nav-links a');

let scrollPosition = 0;

function openMobileMenu() {
    hamburger.classList.add('opened');
    hamburger.setAttribute('aria-expanded', 'true');
    mobileMenu.classList.add('open');

    // Body scroll blokkeren
    scrollPosition = window.scrollY;
    document.body.style.position = 'fixed';
    document.body.style.top = `-${scrollPosition}px`;
    document.body.style.left = '0';
    document.body.style.right = '0';
    document.body.style.overflow = 'hidden';
}

function closeMobileMenu() {
    hamburger.classList.remove('opened');
    hamburger.setAttribute('aria-expanded', 'false');
    mobileMenu.classList.remove('open');

    // Body scroll weer toestaan
    document.body.style.position = '';
    document.body.style.top = '';
    document.body.style.left = '';
    document.body.style.right = '';
    document.body.style.overflow = '';

    // Scroll terugzetten naar vorige positie
    window.scrollTo(0, scrollPosition);
}

hamburger.addEventListener('click', () => {
    if (hamburger.classList.contains('opened')) {
        closeMobileMenu();
    } else {
        openMobileMenu();
    }
});

// Menu sluiten bij klikken op link in mobiel menu + active class bijhouden
mobileLinks.forEach((link, index) => {
    link.dataset.index = index;
    link.addEventListener('click', () => {
        closeMobileMenu();

        // Active class mobiel
        mobileLinks.forEach(l => l.classList.remove('active'));
        link.classList.add('active');

        // Active class desktop
        desktopLinks.forEach(dl => dl.classList.remove('active'));
        desktopLinks[index].classList.add('active');

        // Update activeIndex
        activeIndex = index;
        moveTo(activeIndex);
    });
});

// Bij resize: sluit mobiel menu bij desktop & zet scroll aan
window.addEventListener('resize', () => {
    if (window.innerWidth > 900) {
        closeMobileMenu();
    }
});
/* =========================
   Navbar
========================= */
.navbar {
    background: #fff;
    position: fixed;
    top: 0;
    width: 100%;
    padding: 10px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    transition: transform 0.3s ease-in-out;

}

.navbar .container {
    max-width: 1600px;
    padding: 0 150px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10500;
}

.logo-wrapper {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.logo {
    height: 60px;
}

/* --- Nav links --- */
.nav-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.nav-links {
    display: flex;
    gap: 40px;
    position: relative;
    z-index: 2;
}

.nav-links a {
    text-decoration: none;
    font-size: 21px;
    color: #535353;
    position: relative;
    transition: color 0.3s ease, transform 0.3s ease;
    text-shadow: 1px 1px 2px rgba(131, 131, 131, 0.4);
}

.nav-links a:hover,
.nav-links a.active {
    transform: scale(1.05);
    color: var(--button-hover);
    opacity: 0.9;
}

/* --- Hamburger button --- */
.menu {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    padding: 0;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9000;
}

.menu svg {
    pointer-events: none;
}

.line {
    fill: none;
    stroke: #535353;
    stroke-width: 6;
    transition:
            stroke-dasharray 600ms cubic-bezier(0.4, 0, 0.2, 1),
            stroke-dashoffset 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

.line1, .line3 {
    stroke-dasharray: 60 207;
}

.line2 {
    stroke-dasharray: 60 60;
}

.opened .line1,
.opened .line3 {
    stroke-dasharray: 90 207;
    stroke-dashoffset: -134;
}

.opened .line2 {
    stroke-dasharray: 1 60;
    stroke-dashoffset: -30;
}

/* --- Ruler styling --- */
.ruler-container {
    position: relative;
    height: 30px;
    width: 100%;
    overflow: hidden;
}

.ruler-container::before,
.ruler-container::after {
    content: "";
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.ruler-container::before {
    left: 0;
    background: linear-gradient(to right, #fff 0%, rgba(255, 255, 255, 0) 100%);
}

.ruler-container::after {
    right: 0;
    background: linear-gradient(to left, #fff 0%, rgba(255, 255, 255, 0) 100%);
}

.ruler {
    display: flex;
    position: absolute;
    height: 100%;
    align-items: flex-end;
    transition: transform 0.5s ease;
}

.tick {
    width: 2px;
    height: 12px;
    background: #5a595966;
    margin-right: 6px;
    box-shadow: 0 1px 3px rgba(90, 89, 89, 0.4);
}

.tick.long {
    height: 18px;
    background: rgba(16, 16, 16, 0.4);
    box-shadow: 0 2px 6px rgba(35, 35, 35, 0.4);
}

.indicator {
    position: absolute;
    top: 5px;
    width: 4px;
    height: 24px;
    background: var(--button-color);
    transition: left 0.5s ease;
    z-index: 8000;
    box-shadow: 0 0 10px rgba(0, 119, 204, 0.5);

    /* FIX: forceer aparte layer zodat kleur niet verdwijnt */
    transform: translateZ(0);
    will-change: left, transform, background;
}

/* --- Mobiel menu --- */
.mobile-menu {
    position: fixed;
    top: 100px;
    left: 0;
    width: 100%;
    height: calc(100vh - 100px);
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(100%);
    transition: all 0.4s ease;
    font-size: 24px;
    font-weight: 500;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);

}

.mobile-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    overflow: hidden
}


.mobile-menu a {
    color: var(--button-color);
    text-decoration: none;
    font-size: 30px;
    transition: color 0.3s ease;
}

.mobile-menu a:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
    opacity: 0.9;
}

/* --- Navbar responsive --- */
@media (min-width: 1001px) {
    .logo-wrapper {
        position: static;
        transform: none;
    }
    .navbar .container {
        justify-content: space-between;
    }
    .menu {
        display: none;
    }
}

@media (max-width: 1000px) {
    .nav-links {
        display: none;
    }
    .navbar {
        padding: 50px 0;
    }
    .ruler-container {
        display: none;
    }
    .logo {
        z-index: 9000;
    }
    .navbar .container {
        padding: 0 50px;
        justify-content: center;
    }
    .logo-wrapper {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1;
    }
}

if tried theme color to transparent but it didnt work i want the weird bar onder the searchbar gone

Why does for…in include inherited properties but Object.keys() does not in JavaScript?

I was iterating over an object in JavaScript and noticed a difference between for…in and Object.keys().

const parent = { inheritedProp: "hello" };
const child = Object.create(parent);
child.ownProp = "world";

// Using for...in
for (let key in child) {
  console.log(key);
}

// Using Object.keys
console.log(Object.keys(child));

Output:

for…in: inheritedProp, ownProp
Object.keys: ownProp

Why does for…in iterate over inherited properties, while Object.keys() only returns the object’s own properties? Is there a specific reason for this behavior in JavaScript?

Strange javascript injection

I have a problem with a client’s website. The html is served fine when the user-agent is a browser, however, the page is not passing online html validation because the server is injecting some javascript code just before the !DOCTYPE tag. If I use wget to download the page I can see the injected stuff. Here it is:

<script>console.log('[PHP] session begin ENDS - 0 ms');</script><script>console.log('[PHP] autologin denied ends - 0.013 ms');</script><script>console.log('[PHP] bot check ENDS - 0.277 ms');</script><script>console.log('[PHP] autologin ENDS - 0.282 ms');</script><script>console.log('[PHP] user id forced to be integer ENDS - 0.867 ms');</script><script>console.log('[PHP] suser banned ENDS - 0.98 ms');</script><script>console.log('[PHP] if bot assign previous session ENDS - 0.985 ms');</script><script>console.log('[PHP] screate new session ENDS - 1.004 ms');</script><script>console.log('[PHP] deal with no last page ENDS - 2.297 ms');</script><script>console.log('[PHP] regenerate autologin ends - 2.301 ms');</script><script>console.log('[PHP] refresh data ends - 431.357 ms');</script>

The client wants this removed but I have no idea where this is coming from (some Apache/php module? a hack?). Any ideas?

I tried inspecting .htaccess, but there’s nothing suspicious there.

Microsoft Leap Software Engineer program [closed]

I have an interview coming up for the Microsoft leap software engineer program and was wonder if anyone can offer any advice about what I should study or expect?

Any information and advice would be appreciated.

I’m expecting string related questions but I am not sure what to expect. This is all new for me.

How to inner text from a span on Playwright?

In span I have number and try to inner text for my test and I can’t do it. I need to check I have 0 or another count of staff and I don’t see result of num_basket in console

<span class="basket-count-items badge badge-primary">1</span>
const num_basket = await page.locator('.basket-count-items.badge').textContent()
 console.log(num_basket)
 if (num_basket !== 0) {await page.locator('//a[@id="dropdownBasket"]').click()
 await page.locator('.btn.btn-danger').click()}

How I can inner text?

java use with java script by using teavm webassembly [closed]

I tried to pass String from javascript to java. And In java code it has some operations. but it give error.

const inputStrPointer = createTeaVMString(input);
const outputStrPointer = teaVM.instance.exports.process(inputStrPointer);
const result = extractString(outputStrPointer);

here the createTeaVMString is like this,

function createTeaVMString(input) {
const strPointer = teaVM.allocateString(input.length);
const strDataPtr = teaVM.stringData(strPointer);
const charArrayPtr = teaVM.objectArrayData(strDataPtr);
const memory = new Uint16Array(teaVM.memory.buffer, charArrayPtr, input.length);
for (let i = 0; i < input.length; i++) {
memory[i] = input.charCodeAt(i);
}
return strPointer;
}

and the exactTeaVMString is like this,

function extractString(strPointer) {
//pointer
    const stringDataPtr = teaVM.stringData(strPointer);
    const length = teaVM.arrayLength(stringDataPtr);
    const charArrayPtr = teaVM.charArrayData(stringDataPtr);
    const memory = new Uint16Array(teaVM.memory.buffer, charArrayPtr, length);
    let result = "";
    for (let i = 0; i < length; i++) {
        result += String.fromCharCode(memory[i]);
    }
    return result;
}

But in the java code,

@Export(name = "process")
public static String process(String input) {

    return new StringBuilder(input).reverse().toString();

}

@Export(name = "type")
public static String type(String input) {
    return  input.toString().getClass().getSimpleName();
}

First process function is working, but second one is not(type).
And I tried lots of these kind of functions. I tried to look references but there are no any references. Then by using AI it tells that js String is not fully converted to java String.

Dynamic tab content from hidden div not rendering reliably with jQuery on PHP page

I’m building a PHP page with multiple tabs (Termijnen, Mandaten, and Admin). Each tab’s content is pre-rendered by PHP inside hidden <div> elements. I then inject the content into a visible container (#tab-content) using jQuery when a tab is clicked.

Here’s the structure of my HTML:

<div id="content-termijnen" style="display:none;">
    <div class="row g-3">
        <?php foreach($termijnen as $t): 
            $statusClass = match($t['status']) {
                'pending' => 'bg-warning text-dark',
                'betaald' => 'bg-success text-white',
                'achterstallig' => 'bg-danger text-white',
                default => 'bg-light text-dark',
            };

            $mandaatNummer = null;
            if (!empty($t['mandaat_id'])) {
                $stmt = $conn->prepare("SELECT mandaat_nummer FROM contributie_mandaten WHERE id = ?");
                $stmt->bind_param("i", $t['mandaat_id']);
                $stmt->execute();
                $stmt->bind_result($mandaatNummer);
                $stmt->fetch();
                $stmt->close();
            }
        ?>
        <div class="col-md-6 col-lg-4">
            <div class="card h-100 shadow-sm">
                <div class="card-body d-flex flex-column justify-content-between">
                    <div>
                        <h5 class="card-title">Termijn #<?= $t['id']; ?></h5>
                        <p class="card-text">
                            Bedrag: €<?= number_format($t['bedrag'], 2, ',', '.'); ?><br>
                            Vervaldatum: <?= date('d-m-Y', strtotime($t['vervaldatum'])); ?><br>
                            <?php if ($mandaatNummer): ?>
                                <span class="badge bg-success">Mandaat: #<?= htmlspecialchars($mandaatNummer); ?></span>
                            <?php else: ?>
                                <span class="badge bg-warning">Geen mandaat gekoppeld</span>
                            <?php endif; ?>
                        </p>
                        <span class="badge <?= $statusClass; ?>"><?= ucfirst($t['status']); ?></span>
                    </div>
                    <div class="mt-3 d-flex gap-2 flex-wrap">
                        <button class="btn btn-sm btn-primary btn-link-mandate" data-termijn-id="<?= $t['id']; ?>">Koppel Mandaat</button>
                        <button class="btn btn-sm btn-outline-primary btn-incasso" data-id="<?= $t['id']; ?>" data-bedrag="<?= number_format($t['bedrag'], 2, ',', '.'); ?>" data-vervaldatum="<?= date('d-m-Y', strtotime($t['vervaldatum'])); ?>">Genereer Incasso</button>
                        <button class="btn btn-sm btn-outline-secondary btn-invoice">Genereer Factuur</button>
                    </div>
                </div>
            </div>
        </div>
        <?php endforeach; ?>
    </div>
</div>

<div id="content-mandaten" style="display:none;">
    <div class="mb-3">
        <button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#createMandateModal">
            Nieuw Mandaat Aanmaken
        </button>
    </div>
    <div class="row g-3">
        <?php foreach($mandaten as $m): 
            $statusClass = match($m['status']) {
                'pending' => 'bg-warning text-dark',
                'actief' => 'bg-success text-white',
                'gepauzeerd' => 'bg-danger text-white',
                'ingetrokken'=> 'bg-danger text-white',
                default => 'bg-light text-dark',
            };
            $ibanPlain = decryptIban($m['iban'], $encKey, $authKey);
        ?>
        <div class="col-md-6 col-lg-4">
            <div class="card h-100 shadow-sm">
                <div class="card-body d-flex flex-column justify-content-between">
                    <div>
                        <h5 class="card-title">Mandaat #<?= $m['mandaat_nummer']; ?></h5>
                        <p class="card-text">IBAN: <?= htmlspecialchars($ibanPlain !== null ? $ibanPlain : 'Ongeldig'); ?></p>
                        <span class="badge <?= $statusClass; ?>"><?= ucfirst($m['status']); ?></span>
                    </div>
                    <div class="mt-3 d-flex gap-2 flex-wrap">
                        <button class="btn btn-sm btn-outline-primary btn-iban" data-id="<?= $m['id']; ?>">Wijzig IBAN</button>
                        <button class="btn btn-sm btn-primary btn-pause" data-id="<?= $m['id']; ?>">Pauzeer</button>
                        <button class="btn btn-sm btn-outline-primary">Intrekken</button>
                        <button class="btn btn-sm btn-success btn-link-term" data-mandaat-id="<?= $m['id']; ?>">Koppel aan Termijn</button>
                    </div>
                </div>
            </div>
        </div>
        <?php endforeach; ?>
    </div>
</div>

<div id="content-admin" style="display:none;">
    <div class="mb-4">
        <button class="btn btn-primary mb-3" data-bs-toggle="modal" data-bs-target="#planModal">Nieuw Plan Aanmaken</button>
        <div class="row g-3">
            <?php foreach($plannen as $p): 
                $statusClass = match($p['status']){
                    'actief' => 'bg-success text-white',
                    'draft' => 'bg-warning text-dark',
                    default => 'bg-secondary text-white'
                };
            ?>
            <div class="col-md-6 col-lg-4">
                <div class="card h-100 shadow-sm">
                    <div class="card-body d-flex flex-column justify-content-between">
                        <div>
                            <h5 class="card-title"><?php echo $p['naam']; ?> €<?php echo number_format($p['bedrag'],2,',','.'); ?></h5>
                            <p class="card-text">Start: <?php echo date('d/m/Y', strtotime($p['startdatum'])); ?><?php if($p['einddatum']) echo ' - Eind: '.date('d/m/Y', strtotime($p['einddatum'])); ?></p>
                            <span class="badge <?php echo $statusClass; ?>"><?php echo ucfirst($p['status']); ?></span>
                        </div>
                        <div class="mt-3 d-flex gap-2">
                            <button class="btn btn-sm btn-outline-primary"><i data-feather="edit-2"></i> Bewerk</button>
                            <button class="btn btn-sm btn-outline-danger"><i data-feather="trash-2"></i> Verwijder</button>
                        </div>
                    </div>
                </div>
            </div>
            <?php endforeach; ?>
        </div>
    </div>
</div>

The tabs themselves are buttons:

<div class="button-group" role="group">
    <button class="btn btn-sm btn-outline-primary active" data-tab="termijnen">Termijnen</button>
    <button class="btn btn-sm btn-outline-primary" data-tab="mandaten">Mandaten</button>
    <button class="btn btn-sm btn-outline-secondary" data-tab="admin">Admin</button>
</div>

JavaScript to load tabs:

function loadTab(tab) {
    const content = $(`#content-${tab}`).html();
    $('#tab-content').html(content);

    if (window.feather) feather.replace(); // for icons
}

I also have search, pagination, and dynamic modals for editing IBANs, pausing mandates, linking mandates to termijnen, etc.

Problem

  • The hidden for Termijnen exists ($(‘#content-termijnen’).length === 1) and contains HTML, but is not visible in the #tab-content container when expected.
  • The hidden s for Mandaten and Admin currently do not exist in the DOM at all when inspected with jQuery ($(‘#content-mandaten’).length === 0).
  • Console logs show that the Termijnen HTML exists, but it does not render initially.
  • Mandaten only exists dynamically if a button is clicked that makes it active.
  • A simple console.log(‘Hello world’); works, so scripts run, but the tab content injection does not appear as expected.
  • All libraries (jQuery, Bootstrap, Feather) are loaded, and no JS errors are present.

Question

  1. Why does content from hidden <div>s sometimes not render when injected into #tab-content, even though the <div> exists and has HTML?
  2. How can I reliably load all tab content immediately on page load or on tab click, so that the dynamic cards, modals, and icons work correctly without requiring extra user interaction?

I tried to render the hidden tab content <div>s (#content-termijnen, #content-mandaten, and #content-admin) into the main container #tab-content using jQuery when the page loads or when a tab button is clicked.

  • I verified that $('#content-termijnen').length === 1 and it contains HTML, so I expected it to appear inside #tab-content on page load.
  • I also verified that console.log('Hello World') in a separate <script> tag works, proving that scripts execute.
  • I expected the Termijnen tab to load automatically, and Mandaten/Admin tabs to populate when their respective buttons are clicked.

Actual results

  • Termijnen HTML exists in the DOM but does not appear in #tab-content, so the content is invisible.
  • Mandaten and Admins are 0 in length initially and do not appear at all.
  • No JavaScript errors occur, and libraries like jQuery and Feather are loaded initially.

Changing a saved image in a gallery by setting state

I am building a simple gallery application. I want to be able to change the main gallery image to a different image when it is clicked using state but am having difficulty. All the images are saved directly in the src folder. In my current code when you select a new image to display the current one disappears but does not change to the selected one, but I can’t make it work. Strangely when I pass a variable directly into the src parameter it works, but not when I do it with state, e.g.:

src={clickedImageId !== "4" ? img2 : img4}

This is my code. Where am I going wrong?

import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import { useState } from "react";
import img1 from "./img1.jpg";
import img2 from "./img2.jpg";
import img3 from "./img3.jpg";
import img4 from "./img4.jpg";

function App() {
  const [clickedImageId, setClickedImageId] = useState("4");
  const [galleryImg, setGalleryImg] = useState(img4);


  function handleClick(e) {
    setClickedImageId(e.target.id);
    setGalleryImg(`img${e.target.id}`);
    console.log(galleryImg, clickedImageId);

    return;
  }

  return (
    <div className="container">
      <div className="gallery">
        <img
          className="img1"
          id="1"
          src={img1}
          onClick={handleClick}
          alt="clouds in blue sky"
        />{" "}
        <img
          className="img2"
          id="2"
          src={img2}
          onClick={handleClick}
          alt="two boys rowing a boat"
        />{" "}
        <img
          className="img3"
          // className={clickedImageId === "3" ? "clicked-img" : "img3"}
          id="3"
          src={img3}
          onClick={handleClick}
          alt="tree in orange dusk"
        />
        <img
          className="img4"
          id={"4"}
          src={clickedImageId !== "4" ? galleryImg : img4}
          onClick={handleClick}
          alt="rocks on the beach"
        />
      </div>
    </div>
  );
}
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>
);

I am struggling with making shared header/footer elements in HTML

I am making a website and I want to build a common header and footer to use on each page that I can define somewhere else, rather than on each individual page. I’ve seen a few different methods that claim to work to take a file I wrote to define my header and footer, and then add it to each page though a function or a script.

The last method I tried extended the HTMLElement into new classes, and then defined those elements with a customElements.define() function, but when I refresh the page I don’t see any output from the .js file.

This is the modules.js file I wrote to define the header and the footer:

class CommonHeader extends HTMLElement {
    connectedCallBack() {
        this.innerHTML = '
        <p style="display: flex; justify-content: space-around; background-color: #eeeeee; padding: 10px;">
            <a href="./index.html">Home</a>
            <a href="./mission.html">Mission</a>
            <a href="./News/news.html">News</a>
            <a href="./Programs/programs.html">Programs</a>
            <a href="./Blog/blog.html">Blog</a>
        </p>
        '
    }
}
class CommonFooter extends HTMLElement {
    connectedCallBack() {
        this.innerHTML = '
        <p style="display: flex; justify-content: space-around; background-color: #eeeeee; padding: 10px;">Copyright &copy;2025; Designed by Sapientiae Domus</p>
        '
    }
}
customElements.define('common-header', CommonHeader)
customElements.define('common-footer', CommonFooter)

And this is the template.html file I’m trying to test with so I can copy this to make the skeleton for each page:

<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="/style.css">

<head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width">
        <title>Sapientiae Domus</title>
</head>

<body>
        <common-header></common-header>
        <h1>Sapientiae Domus</h1>
        <p>This is a home page...</p>
        <common-footer></common-footer>
        <script src="./modules.js"></script>
        <p style="display: flex; justify-content: space-around; background-color: #eeeeee; padding: 10px;">Copyright &copy;
                2025; Designed by Sapientiae Domus</p>
</body>

</html>

I have a script that runs to set up a local web server to host the site on my machine because I read that certain functions wouldn’t call the right way if you simply use the browser to search the files.

When I check the console on the webpage I get this message: "Uncaught SyntaxError: '' string literal contains an unescaped line break" with modules.js:3:20 in the corner of the error box. I tried looking it up, and what I found said to break the lines putting each into a string and following them with a ‘+’ to add them together but I couldn’t make that work properly either. I undid that and put the code in the format the example was given in, and that’s what is shown above.

Typed property AppEntityX:X must not be accessed before initialization

I’m trying to upgrade my Symfony from 5.4 to 6.4 and PHP from 7.4 to 8.4. I almost did all changes but I’m currently blocked on this exception :

Typed property AppEntityAppRole::$uniqid must not be accessed before initialization

I already did my researchs and found that private properties must be initialized, so this is what I did :

#[ORMColumn(name: "uniqid", type: "string", length: 50, nullable: false)]
private ?string $uniqid = null;
public function getUniqid(): ?string
{
    return $this->uniqid;
}

public function setUniqid(string $uniqid): self
{
    $this->uniqid = $uniqid;

    return $this;
}

So I don’t understand where comes my error ?

The error trace shows that it comes from the findAll() repository function.

Did I missed something ?

I also cleared the cache but does nothing.

Thanks

Does Xero not provide an API or built-in function to fetch daily data? [closed]

We have a custom system, and we are trying to integrate Xero’s daily sales data into this system. But we are unable to do that.
I would like to confirm whether Xero provides any API or built-in functionality that allows us to fetch daily data (such as daily sales, transactions, or other relevant reports). From my current exploration, I could not find such an option, but I wanted to double-check with your team in case I may have overlooked it.

If this feature is not available, could you kindly suggest an alternative approach or workaround to achieve daily data extraction from Xero?

API failed to open stream: connection refused [closed]

After installing web application, I added the api key to the built in setting in the admin dashboard. The api was calling and getting data, the next day I get an error code saying “failed to open stream: connection refused? cleared cache and dug into the files and nothing seems to be wrong on the app. Its using File_get_contents

So if it was working yesterday, but not today? I am guessing the server or something or something is blocking it. Unless I was sleepwalking and accidently changed a code while in my sleep?

anyone got any ideas?

Netsuite PHP find Sales Order using custom field

Kind of embarrassed to post this here, but I’m at my wits end. I am trying to pull up a Sales Order in Netsuite, searching on a custom filed and using the PHP ToolKit, but have hit a brick wall. I’ve searched records on custom fields before and haven’t had an issue, but this time I’m getting no results. This custom field is a place where we store an outside order number (like if the order came from Amazon or eBay) and I can pull up the record inside of Netsuite (using the GUI) with this custom field. Currently my code looks like this:

$ts = new TransactionSearch();
$tsb = new TransactionSearchBasic();
$oth = new SearchStringCustomField();
$oth->internalId = 69;
$oth->searchValue = '700184356';
$oth->operator = 'is';
$cfl = new SearchCustomFieldList();
$cfl->customField = array($oth);
$tsb->customFieldList = $cfl;
$ts->basic = $tsb;
$request = new SearchRequest();
$request->searchRecord = $ts;
$response = $ns->search($request);

I’ve double and triple checked the id of the custom field and also tried using its name instead of id ($oth->scriptId = 'custbody_custbody_storefront_order'). I get no errors, but also no records are returned. I’m hoping an extra set of eyes can spot what I’m doing wrong.

Custom field name