popup not function in openlayer

write code for maps portal of the city. I have problem with my code. I thing that problem is in my js file. I didn´t find answer here and in youtube, but code still not function. When I click on polygon in map, don´t show popup window with data from geoserver. and I’m just a student 🙂 Can you help me please?
html code

<!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>Géoportail-Taza</title>
    <link rel="stylesheet" href="ressource/ol/ol.css">
    <link rel="stylesheet" href="ressource/layerswitcher/ol-layerswitcher.css">
    <link rel="stylesheet" href="main.css">
</head>
<body>

<div class="grid-container">
    <div class="header">
        <img src="ressource/images/logo.jpg" alt="" style="width: inherit; height: inherit; vertical-align: middle;">
        <span style="vertical-align: middle;">Géoportail de Géotourisme</span>
    </div>
    
    <div class="left">
        <div class="toc">
            <h3>Cartes</h3>
            <input type="checkbox" id="osm" name="osm" value="Open street Map" checked onchange="toggleLayer(event);">
            <label for="osm">OpenstreetMap</label>
            <br>
            <input type="checkbox" id="esri" name="esri" value="ESRI Satellite Imagery" checked onchange="toggleLayer(event);">
            <label for="esri">ESRI Satellite Imagery</label>
            <br>
            <h3>Couches</h3>
            <input type="checkbox" id="province" name="province" value="province_taza_pg" checked onchange="toggleLayer(event);">
            <label for="province">Taza</label>
            <br>
            <input type="checkbox" id="communes" name="communes" value="communes_taza_pg" checked onchange="toggleLayer(event);">
            <label for="communes">Communes de Taza</label>
            <br>
            <h4>Ressource Naturelles</h4>
            <input type="checkbox" id="Puits" name="Puits" value="PuitsTAZA" checked onchange="toggleLayer(event);">
            <label for="Puits">Source d'eaux</label>
            <br>
            <input type="checkbox" id="Jbel" name="Jbel" value="Jbels_Haut_Inaouene" checked onchange="toggleLayer(event);">
            <label for="Jbel">Sommet de Montagne</label>
            <br>
        </div>
    </div>
    <div class="right">
        <div id="map" class="map"></div>
        <div id="popup" class="ol-popup">
            <a href="#" id="popup-closer"> </a>
            <div id="popup-content"> </div>
            <div class="attQueryDiv" id="attQueryDiv">
                <div class="headerDiv" id="headerDiv">
                  <label for="">Attribute Query</label>
                </div>
                <br>
                <label for="selectLayer">Select Layer:</label>
                <select name="selectLayer" id="selectLayer">
                  <!-- Populate this select box with layer options -->
                </select><br><br>
                <label for="selectAttribute">Select Attribute:</label>
                <select name="selectAttribute" id="selectAttribute">
                  <!-- Populate this select box with attribute options -->
                </select><br><br>
                <label for="selectOperator">Select Operator:</label>
                <select name="selectOperator" id="selectOperator">
                  <!-- Populate this select box with operator options -->
                </select><br><br>
                <label for="enterValue">Enter Value:</label>
                <input type="text" name="enterValue" id="enterValue"><br><br>
                <button type="button" id="attQryRun" class="attQryRun" onclick="attributeQuery()">Run</button>
              </div>

        </div>

            </div>
        <div id="scale-line"></div>
        <div id="mouse-position"></div>
        </div>

    </div>
</div>
<script src="ressource/ol/ol.js"></script>
<script src="ressource/layerswitcher/ol-layerswitcher.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="main.js"></script>
</body>
</html>`

and for javascript code

var mapView = new ol.View({
  center: ol.proj.fromLonLat([-3.9980485, 34.2105603]),
  zoom: 8
});

var map = new ol.Map({
  target: 'map',
  view: mapView,
  controls: []
});

var osmTile = new ol.layer.Tile({
  title: 'Open Street Map',
  type: 'base',
  visible: true,
  source: new ol.source.OSM()
});

map.addLayer(osmTile);

var esriSatellite = new ol.layer.Tile({
  title: 'ESRI Satellite Imagery',
  visible: true,
  source: new ol.source.XYZ({
      url: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
      attributions: 'Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
  })
});

map.addLayer(esriSatellite);

var tazacommunesTile = new ol.layer.Tile({
  title: "communes_taza_pg",
  source: new ol.source.TileWMS({
    url: 'http://localhost:8080/geoserver/Prov_taza/wms',
    attributions:'geoserver',
      params: {'LAYERS':'Province_Taza:communes_taza_pg','TILED':true},
      serverType: 'geoserver',
      visible: true,
  })
});
tazacommunesTile.setOpacity(1);

map.addLayer(tazacommunesTile);

var tazaprovinceTile = new ol.layer.Tile({
  title: "province_taza_pg",
  source: new ol.source.TileWMS({
    url: 'http://localhost:8080/geoserver/Prov_taza/wms',
    params: {'LAYERS':'Province_Taza:province_taza_pg','TILED':true},
      serverType: 'geoserver',
      visible: true,
  })
});
tazaprovinceTile.setOpacity(0.2);

map.addLayer(tazaprovinceTile);



var jbelsHautInaoueneTile = new ol.layer.Tile({
  title: "Jbels_Haut_Inaouene",
  source: new ol.source.TileWMS({
    url: 'http://localhost:8080/geoserver/Prov_taza/wms',
    params: {'LAYERS':'Province_Taza:Jbels_Haut_Inaouene','TILED':true},
      serverType: 'geoserver',
      visible: true,
  })
});
jbelsHautInaoueneTile.setOpacity(0.4);

map.addLayer(jbelsHautInaoueneTile);

var puitsTile = new ol.layer.Tile({
  title: "PuitsTAZA",
  source: new ol.source.TileWMS({
    url: 'http://localhost:8080/geoserver/Prov_taza/wms',
    params: {'LAYERS':'Province_Taza:PuitsTAZA','TILED':true},
      serverType: 'geoserver',
      visible: true,
  })
});
puitsTile.setOpacity(0.4);

map.addLayer(puitsTile);

var layerswitcher = new ol.control.LayerSwitcher({
  activationMode: 'click',
  startActive: false,
  groupSelectstyle: 'children'
});

map.addControl(layerswitcher);

var mousePositionControl = new ol.control.MousePosition({
  coordinateFormat:ol.coordinate.createStringXY(4),
  projection: 'EPSG:4326',
  className: 'mouse-position'
});

map.addControl(mousePositionControl);

var scaleLineControl = new ol.control.ScaleLine({
  units: 'metric',
  target: document.getElementById('scale-line'),
  className: 'ol-scale-line',
  bar: true,
  text: true
});

map.addControl(scaleLineControl);

function toggleLayer(e) {
  var lyrname = e.target.value;
  var checkedstatus = e.target.checked;
  var lyrList = map.getLayers();
  lyrList.forEach(function(element){
      if (lyrname === element.get('title')){
          element.setVisible(checkedstatus);
      }
  });
}
//GetFeature info
// Créer une couche de popup
const container = document.getElementById('popup');
const content = document.getElementById('popup-content');
const closer = document.getElementById('popup-closer');

const overlay = new ol.Overlay({
  element: container,
  autoPan: {
    animation: {
      duration: 250,
    },
  },
});
map.addOverlay(overlay);

closer.onclick = function () {
  overlay.setPosition(undefined);
  closer.blur();
  return false;
};

map.on('singleclick', function(evt) {
  content.innerHTML = ''; // Effacer le contenu précédent
  var resolution = mapView.getResolution();
  var url = tazacommunesTile.getSource().getFeatureInfoUrl(evt.coordinate, resolution, 'EPSG:4326', {
    'INFO_FORMAT': 'application/json',
    'propertyName': 'nom_commun,nom_comm_1'
  });

  if (url) {
    $.getJSON(url, function(data) {
      var feature = data.features[0];
      var props = feature.properties;
      content.innerHTML = "<h3> Commune : </h3> <p>" + props.nom_commun.toUpperCase() + "</p> <br> <h3> Communes 1: </h3> <p>" + props.nom_comm_1.toUpperCase() + "</p>";
      overlay.setPosition(evt.coordinate);
    });
  } else {
    overlay.setPosition(undefined);
  }
});


// Create the home button
const homeButton = document.createElement('button');
homeButton.innerHTML = '<img src="/files/home.svg" alt="" style="width: 20px; height:20px; filter: brightness(0) invert(1); vertical-align: middle;">';
homeButton.className = 'myButton';

// Create the home button container
const homeElement = document.createElement('div');
homeElement.className = 'homeButtonDiv';
homeElement.appendChild(homeButton);

// Create the home control
const homeControl= new ol.control.Control({
  element: homeElement
});

// Add the home control to the map
map.addControl(homeControl);

// Add click event listener to the home button
homeButton.addEventListener("click", () => {
  location.href = "index.html";
});

// Create full screen control
const fsButton = document.createElement('button');
fsButton.innerHTML = '<img src="/files/fullscreen.svg" alt="" style="width: 20px; height: 20px; filter: brightness(0) invert(1);">';
fsButton.className = 'myButton';

const fsElement = document.createElement('div');
fsElement.className = 'fsButtonDiv';
fsElement.appendChild(fsButton);

const fsControl = new ol.control.Control({ element: fsElement });

fsButton.addEventListener("click", () => {
  const mapEle = document.getElementById("map");
  if (mapEle.requestFullscreen) {
    mapEle.requestFullscreen();
  } else if (mapEle.msRequestFullscreen) {
    mapEle.msRequestFullscreen();
  } else if (mapEle.mozRequestFullscreen) {
    mapEle.mozRequestFullscreen();
  } else if (mapEle.webkitRequestFullscreen) {
    mapEle.webkitRequestFullscreen();
  }
});

map.addControl(fsControl);
//test
// start: ZoomIn Control
var ZoomInInteraction = new ol.interaction.DragBox();

ZoomInInteraction.on('boxend', function () {
  var ZoomInExtent = ZoomInInteraction.getGeometry().getExtent();
  var zoomInFactor = 2; // Adjust this value to change the zoom level increase amount
  var newZoomLevel = map.getView().getZoom() + zoomInFactor;
  map.getView().fit(ZoomInExtent, {size: map.getSize(), duration: 250, maxZoom: newZoomLevel});
});

var ziButton = document.createElement('button');
ziButton.innerHTML = '<img src="files/zoomin.svg" alt="" salt="" style="width: 20px; height: 20px; filter: brightness(0) invert(1)">';
ziButton.className = 'myButton';
ziButton.id = 'ziButton';

var ziElement = document.createElement('div');
ziElement.className = 'ziButtonDiv';
ziElement.appendChild(ziButton);

var ZoomInFlag = false;
ziButton.addEventListener("click", () => {
  ziButton.classList.toggle('clicked');
  ZoomInFlag = !ZoomInFlag;
  if (ZoomInFlag) {
    document.getElementById("map").style.cursor = 'zoom-in';
    map.addInteraction(ZoomInInteraction);
  } else {
    document.getElementById("map").style.cursor = 'auto';
    map.removeInteraction(ZoomInInteraction);
  }
});

var ziControl = new ol.control.Control({
  element: ziElement
});
map.addControl(ziControl);
// end: ZoomIn Control
// start: ZoomOut Control
var ZoomOutInteraction = new ol.interaction.DragBox();

ZoomOutInteraction.on('boxend', function () {
  var ZoomOutExtent = ZoomOutInteraction.getGeometry().getExtent();
  var zoomOutFactor = 2; // Adjust this value to change the zoom level decrease amount
  var newZoomLevel = map.getView().getZoom() - zoomOutFactor;
  map.getView().setZoom(newZoomLevel);
});

var zoButton = document.createElement('button');
zoButton.innerHTML = '<img src="/files/zoomOut.svg" alt="" salt="" style="width: 20px; height: 20px; filter: brightness(0) invert(1)">';
zoButton.className = 'myButton';
zoButton.id = 'zoButton';

var zoElement = document.createElement('div');
zoElement.className = 'zoButtonDiv';
zoElement.appendChild(zoButton);

var ZoomOutFlag = false;
zoButton.addEventListener("click", () => {
  zoButton.classList.toggle('clicked');
  ZoomOutFlag = !ZoomOutFlag;
  if (ZoomOutFlag) {
    document.getElementById("map").style.cursor = 'zoom-out';
    map.addInteraction(ZoomOutInteraction);
  } else {
    document.getElementById("map").style.cursor = 'auto';
    map.removeInteraction(ZoomOutInteraction);
  }
});

var zoControl = new ol.control.Control({
  element: zoElement
});
map.addControl(zoControl);
// end: ZoomOut Control

// Create a button element for length measurement
var lengthButton = document.createElement('button');
lengthButton.innerHTML = '<img src="/files/Length.svg" alt="" salt="" style="width: 20px; height: 20px; filter: brightness(0) invert(1)">';
lengthButton.className = 'myButton';
lengthButton.id = 'lengthButton';

// Create a div element to hold the button
var lengthElement = document.createElement('div');
lengthElement.className = 'lengthButtonDiv';
lengthElement.appendChild(lengthButton);

// Create a new OpenLayers control for the length measurement button
var lengthControl = new ol.control.Control({
  element: lengthElement
})

// Initialize a flag to track the state of the length measurement tool
var lengthFlag = false;

// Add an event listener to the length button
lengthButton.addEventListener("click", () => {
  // Toggle the 'clicked' class on the button
  lengthButton.classList.toggle('clicked');
  
  // Toggle the lengthFlag
  lengthFlag =!lengthFlag;
  
  // Update the cursor style on the map
  document.getElementById("map").style.cursor = "default";
  
  if (lengthFlag) {
    // Remove any existing draw interaction
    map.removeInteraction(draw);
    
    // Add a new draw interaction for LineString
    draw = new ol.interaction.Draw({
      source: source,
      type: 'LineString',
      style: new ol.style.Style({
        fill: new ol.style.Fill({
          color: 'rgba(255, 255, 255, 0.2)',
        }),
        stroke: new ol.style.Stroke({
          color:'#ffcc33',
          width: 2,
        }),
        image: new ol.style.Circle({
          radius: 7,
          fill: new ol.style.Fill({
            color: '#ffcc33',
          }),
        }),
      })
    });
    map.addInteraction(draw);
    createMesureTooltip();
    createHelpTooltip();

    var sketch;

    var pointerMoveHandler = function (evt) {
      if (evt.dragging) {
        return;
      }
      var helpMsg = 'Click to start drawing';
      if (sketch) {
        var geom = sketch.getGeometry();
        if (geom instanceof ol.geom.LineString) {
          helpMsg = continueLineMsg;
        }
      }
      helpTooltipElement.innerHTML = helpMsg;
      helpTooltip.setPosition(evt.coordinate);
      helpTooltipElement.classList.remove('hidden');
    };

    map.on('pointermove', pointerMoveHandler);

    draw.on('drawstart', function (evt) {
        sketch = evt.feature;
        var tooltipCoord = evt.coordinate;
        sketch.getGeometry().on('change', function (evt) {
            var geom = evt.target;
            var output;
            if (geom instanceof ol.geom.LineString) {
                output = formatLength(geom);
                tooltipCoord = geom.getLastCoordinate();
            }
            measureTooltipElement.innerHTML = output;
            measureTooltip.setPosition(tooltipCoord);
        });
    });


    draw.on('drawend', function () {
        measureTooltipElement.ClassName='ol-tooltip ol-tooltip-static';
        measureTooltip.setOffset([0,-7]);
        sketch = null;
        measureTooltipElement = null;
        createMesureTooltip();
    });
  } else {
    map.removeInteraction(draw);
    source.clear();
    const elements = document.getElementsByClassName("ol-tooltip ol-tooltip-static");
    while (elements.length > 0) elements[0].remove();
  }
});

// Add the length control to the map
map.addControl(lengthControl);

// Create a button element for area measurement
var areaButton = document.createElement('button');
areaButton.innerHTML = '<img src="/files/area.svg" alt="" style="width: 20px; height: 20px; filter: brightness(0) invert(1)">';
areaButton.className = 'myButton';
areaButton.id = 'removeButton';

var areaElement = document.createElement('div');
areaElement.className = 'areaButtonDiv';
areaElement.appendChild(areaButton);

var areaControl = new ol.control.Control({
  element: areaElement
})

var areaFlag = false;
areaButton.addEventListener("click", () => {
  areaButton.classList.toggle('clicked');
  areaFlag = !areaFlag;
  document.getElementById("map").style.cursor = "default";

  if (areaFlag) {
    map.removeInteraction(draw);
    draw = new ol.interaction.Draw({
      source: source,
      type: 'Polygon',
      style: new ol.style.Style({
        fill: new ol.style.Fill({
          color: 'rgba(255, 255, 255, 0.2)',
        }),
        stroke: new ol.style.Stroke({
          color:'#ffcc33',
          width: 2,
        }),
        image: new ol.style.Circle({
          radius: 7,
          fill: new ol.style.Fill({
            color: '#ffcc33',
          }),
        }),
      })
    });
    map.addInteraction(draw);
    createMesureTooltip();
    createHelpTooltip();

    var sketch;

    var pointerMoveHandler =function (evt) {
      if (evt.dragging) {
        return;
      }
      var helpMsg = 'Click to start drawing';
      if (sketch) {
        var geom = sketch.getGeometry();
        if (geom instanceof ol.geom.Polygon) {
          helpMsg = continuePolygonMsg;
        }
      }
      helpTooltipElement.innerHTML = helpMsg;
      helpTooltip.setPosition(evt.coordinate);
      helpTooltipElement.classList.remove('hidden');
    };

    map.on('pointermove', pointerMoveHandler);

    draw.on('drawstart', function (evt) {
        sketch = evt.feature;
        var tooltipCoord = evt.coordinate;
        sketch.getGeometry().on('change', function (evt) {
            var geom = evt.target;
            var output;
            if (geom instanceof ol.geom.Polygon) {
                output = formatArea(geom);
                tooltipCoord = geom.getInteriorPoint().getCoordinates();
            }
            measureTooltipElement.innerHTML = output;
            measureTooltip.setPosition(tooltipCoord);
        });
    });


    draw.on('drawend', function () {
        measureTooltipElement.ClassName='ol-tooltip ol-tooltip-static';
        measureTooltip.setOffset([0,-7]);
        sketch = null;
        measureTooltipElement = null;
        createMesureTooltip();
    });
  } else {
    map.removeInteraction(draw);
    source.clear();
    const elements = document.getElementsByClassName("ol-tooltip ol-tooltip-static");
    while (elements.length > 0) elements[0].remove();
  }
});

map.addControl(areaControl);

function createMesureTooltip() {
  if (measureTooltipElement) {
    measureTooltipElement.parentNode.removeChild(measureTooltipElement);
  }
  measureTooltipElement = document.createElement('div');
  measureTooltipElement.className = 'ol-tooltip ol-tooltip-measure';
  measureTooltip = new ol.Overlay({
    element: measureTooltipElement,
    offset: [0, -15],
    positioning: 'bottom-center'
  });
  map.addOverlay(measureTooltip);
}

function createHelpTooltip() {
  if (helpTooltipElement) {
    helpTooltipElement.parentNode.removeChild(helpTooltipElement);
  }
  helpTooltipElement = document.createElement('div');
  helpTooltipElement.className = 'ol-tooltip hidden';
  helpTooltip = new ol.Overlay({
      element: helpTooltipElement,
      offset: [15, 0],
      positioning: 'center-left',
  });
  map.addOverlay(helpTooltip);
}

var continuePolygonMsg = 'Click to continue polygon, Double click to complete';
var continueLineMsg = 'Click to continue line, Double click to complete';

var draw;

var source = new ol.source.Vector();
var vector = new ol.layer.Vector({
  source: source,
  style: new ol.style.Style({
    fill: new ol.style.Fill({
      color: 'rgba(255, 255, 255, 0.2)',
    }),
    stroke: new ol.style.Stroke({
      color:'#ffcc33',
      width: 2,
    }),
    image: new ol.style.Circle({
      radius: 7,
      fill: new ol.style.Fill({
        color: '#ffcc33',
      }),
    }),
  }),
});
map.addLayer(vector);
//test
var removeButton = document.createElement('button');
removeButton.innerHTML = '<img src="/files/remove.svg" alt="" style="width: 20px; height: 20px; filter: brightness(0) invert(1)">';
removeButton.className = 'myButton';
removeButton.id = 'removeButton';

var removeElement = document.createElement('div');
removeElement.className = 'removeButtonDiv';
removeElement.appendChild(removeButton);

var removeControl = new ol.control.Control({
  element: removeElement
});

map.addControl(removeControl);

removeButton.addEventListener("click", () => {
  map.removeLayer(vector);
  source.clear();
  const elements = document.getElementsByClassName("ol-tooltip ol-tooltip-static");
  while (elements.length > 0) elements[0].remove();
});
//add button
var geojson;
var featureOverlay;

var qryButton = document.createElement('button');
qryButton.innerHTML = '<img src="/files/query.svg" alt="" style="width: 20px; height: 20px; filter: brightness(0) invert(1)">';
qryButton.className = 'myButton';
qryButton.id = 'qryButton';

var qryElement = document.createElement('div');
qryElement.className = 'myButtonDiv';
qryElement.appendChild(qryButton);

var qryControl = new ol.control.Control({
  element: qryElement
});

var qryFlag = false;

qryButton.addEventListener("click", () => {
  // disableOtherInteraction('lengthButton');
  qryButton.classList.toggle('clicked');
  qryFlag = !qryFlag;
  document.getElementById("map").style.cursor = "default";
  if (qryFlag) {
    if (geojson) {
      geojson.getSource().clear();
      map.removeLayer(geojson);
    }
    if (featureOverlay) {
      featureOverlay.getSource().clear();
      map.removeLayer(featureOverlay);
      document.getElementById("map").style.cursor = "default";
      document.getElementById("attQueryDiv").style.display = "block";
      bolIdentify = false;
      addMapLayerList();
    }
  } else {
      document.getElementById("map").style.cursor = "default";
      document.getElementById("attQueryDiv").style.display = "none";
      document.getElementById("attListDiv").style.display = "none";
      if (geojson) {
          geojson.getSource().clear();
          map.removeLayer(geojson);
          if (featureOverlay) {
              featureOverlay.getSource().clear();
              map.removeLayer(featureOverlay);
          }
      }
  }
})
map.addControl(qryControl);

I will be so thankfull if anyone can help for real <3

I try to show the attribute of the layer that I added from geoserver and It does’nt function and the samething for length and area mesuring and qrybutton

My mobile submenu won’t animate to slide down

I made a mobile version of my menu that includes a sub menu. I managed to get it to open when the <li> is clicked, but I can’t get it to animate. I want it to slide down.

I tried the following:

My menu item:

.menu-item-has-children {
position: relative;
}

My sub-menu item (gets “open” class when menu-item-has-children is clicked through JS):

.sub-menu {
display: none;
max-height: 0px;
transition: all .3s ease;
}

.sub-menu.open {
display: block;
max-height: 9999px;
}

However the height doesn’t animate, when the menu item is being clicked the sub-menu simply appears without a transition. I’ve seen this being done with JS but I can’t figure out how.

Any help would be greatly appreciated 🙂

Background color not changing in isActive NavLink React JavaScript

The Background color of the selected list item isn’t changing, only the text color is changing to white.

import { NavLink } from "react-router-dom";
import { useTranslation } from "react-i18next";
import { MyContext } from "./links/MyContext.jsx";
import { useContext } from "react";

export default function HeaderLists() {
  const [t] = useTranslation();
  const { isDarkMode } = useContext(MyContext);

  const activeLink = `bg-gradient-to-r from-cyan-800 to-blue-800 text-white `;
  const normalLink = `hover:text-white hover:border-none ${
    isDarkMode
      ? "text-white from-blue-950 to-cyan-900"
      : "text-stone-600 border-stone-600"
  }`;

  return (
    <ul className="mt-10 text-center">
      <NavLink
        to="/"
        className={({ isActive }) => (isActive ? activeLink : normalLink)}
      >
        <li className="border-b-2 border-b-stone-500 p-5 hover:bg-gradient-to-r from-cyan-500 to-blue-600">
          {t("tasks")}{" "}
        </li>
      </NavLink>

      <NavLink
        to="/Calendar"
        className={({ isActive }) => (isActive ? activeLink : normalLink)}
      >
        <li className="border-b-2 border-b-stone-500 p-5 hover:bg-gradient-to-r from-cyan-500 to-blue-600">
          {t("calendar")}
        </li>
      </NavLink>

      <NavLink
        to="/Settings"
        className={({ isActive }) => (isActive ? activeLink : normalLink)}
      >
        <li className="border-b-2 border-b-stone-500 p-5 hover:bg-gradient-to-r from-cyan-500 to-blue-600">
          {t("settings")}{" "}
        </li>
      </NavLink>
    </ul>
  );
}

When I select a list item such as Tasks, or Calendar, the selected item color is then changed to white, but the background color remains the same. It won’t change to the gradient I specified in activeLink const. I would like to know how I can fix it.

Why does the Adblocker that I have created block stylesheets and not just ads?

I am creating an Adblocker clone using manifest 3, and for some reason whenever the ad blocker is on it removes both the ads on the site and the css stylesheet, leaving only the html file.

here is my manifest file:

{
    "name" : "Rock AdBlocker", 
    "description" : "Block all annoying ads", 
    "manifest_version" : 3,
    "version" : "0.1.0",
    "permissions" : ["declarativeNetRequest"],
    "declarative_net_request" : {
        "rule_resources" : [
            {
                "id" : "ruleset_1", 
                "enabled" : true,
                "path" : "rules.json"
            }
        ]
    }
}

and here is my rules.json file that is referenced above:

[
    {
        "id" : 1, 
        "priority" : 1, 
        "action" : {"type" : "block"}, 
        "condition" : {"urlfilter" : "*://*doubleclick.net/*"}
    }, 
    {
        "id" : 2, 
        "priority": 1, 
        "action" : {"type" : "block"}, 
        "condition" : {"urlfilter" : "*://googleadservices.com/*"}
    }
]

so what might be the issue and how to fix it? I am still new to this whole extensions stuff.

Cannot use getImageData within content.js [The Canvas has been tainted by cross-origin data]

I am creating a chrome extension that reads all images within a page and runs a deep learning model on them.

  let width = canvas.width;
  let height = canvas.height;
  let startX = (width - size) / 2;
  let startY = (height - size) / 2;
  let ctx = canvas.getContext('2d');
  let imageData = ctx.getImageData(startX, startY, size, size);

A lot of the times, I get the following error

Uncaught (in promise) DOMException: Failed to execute ‘getImageData’ on ‘CanvasRenderingContext2D’: The canvas has been tainted by cross-origin data.

Is there any other way for getting the imageData?

Reducing image size to 200kb before uploading using javascript is not working

I want to reduce image size to 200kb before uploading that image to server. I am having 5 different inputs for selecting 5 files. I tried using the following code, but still no luck. My images are still getting uploaded as it is (with original size). Kindly help me out. Thanks.
Here is my code that I tried so far:

<div class="col-sm-6">  
<label class="form-label"><strong>ID Proof Front Photo:</strong></label>
<img src="" alt="No Image" id="img1" style='height:150px; display:none;'>                       
<button type="button" id="uploadFrontID" class="registerBtn" onblur="validateIDCardType(), validateFileTypeFront()" onclick="validateIDCardType(), selectFile('frontIDProof')"><img width="35" height="24" src="<?php echo $url; ?>assets/images/id1.svg">  <strong>Select Photo</strong></button>
<input type='file' id="frontIDProof" name="uploadIDFrontPhoto" onchange="readURL1(this)"  style="display:none" accept="image/*" required />
<span id="photoFrontSpan" class="errSpan"></span>
</div>

<div class="col-sm-6">  
<label class="form-label"><strong>ID Proof Back Photo:</strong></label>
<img src="" alt="No Image" id="img2" style='height:150px; display:none;'>
<button type="button" id="uploadBackID" class="registerBtn" onblur="validateFrontID(), validateIDCardType(), validateFileTypeBack()" onclick=" validateIDCardType(), selectFile('backIDProof')"><img width="35" height="24" src="<?php echo $url; ?>assets/images/id2.svg">  <strong>Select Photo</strong></button>
<input type='file' id="backIDProof" name="uploadIDBackPhoto" style="display:none" onchange="readURL2(this)" accept="image/*" required />
<span id="photoBackSpan" class="errSpan"></span>
</div>

<div class="col-sm-6">  
<label class="form-label"><strong>Profile Photo 1:</strong></label>
<img src="" alt="No Image" id="img3" style='height:150px; display:none;'>                           
<button type="button" id="profilePhoto1" class="registerBtn" onblur=" validateProfilePhoto1FileType()" onclick="selectFile('profilePhotoFile1')"><img width="24" height="24" src="<?php echo $url; ?>assets/images/photo1.svg">  <strong>Select Photo</strong></button>
<input type='file' onchange="readURL3(this)" id="profilePhotoFile1" name="uploadPhoto1" style="display:none" accept="image/*" required />
<span id="photoSpan1" class="errSpan"></span>                                   
</div>

<div class="col-sm-6">  
<label class="form-label"><strong>Profile Photo 2:</strong></label>
<img src="" alt="No Image" id="img4" style='height:150px; display:none;'>                           
<button type="button" id="profilePhoto2" class="registerBtn" onblur="validateProfilePhoto2FileType()" onclick="selectFile('profilePhotoFile2')"><img width="24" height="24" src="<?php echo $url; ?>assets/images/photo2.svg">  <strong>Select Photo</strong></button>
<input type='file' id="profilePhotoFile2" onchange="readURL4(this)" name="uploadPhoto2" style="display:none" accept="image/*"/>
<span id="photoSpan2" class="errSpan"></span>
</div>

<div class="col-sm-6">  
<label class="form-label"><strong>Profile Photo 3:</strong></label>
<img src="" alt="No Image" id="img5" style='height:150px; display:none;'>                           
<button type="button" id="profilePhoto3" class="registerBtn" onblur="validateProfilePhoto3FileType()" onclick="selectFile('profilePhotoFile3')"><img width="24" height="24" src="<?php echo $url; ?>assets/images/photo3.svg">  <strong>Select Photo</strong></button>
<input type='file' id="profilePhotoFile3" name="uploadPhoto3" onchange="readURL5(this)" style="display:none" accept="image/*"/>
<span id="photoSpan3" class="errSpan"></span>
</div>

  <script>
  //Image resize code starts

        function selectFile(inputId) {
            document.getElementById(inputId).click();
        }
        
        function compressImage(file, maxSizeKB, callback) {
            const reader = new FileReader();
            reader.onload = function(event) {
                const img = new Image();
                img.onload = function() {
                    const canvas = document.createElement('canvas');
                    const ctx = canvas.getContext('2d');
                    
                    // Set the canvas dimensions to the image dimensions
                    canvas.width = img.width;
                    canvas.height = img.height;
                    
                    // Draw the image on the canvas
                    ctx.drawImage(img, 0, 0);
                    
                    let compressedFile;
                    let scaleFactor = 0.9; // Initial scale factor
                    
                    do {
                        // Compress the image as JPEG by default
                        let dataUrl = canvas.toDataURL('image/jpeg', 0.7);
                        
                        // If the file type is PNG, compress as PNG format
                        if (file.type === 'image/png') {
                            const pngDataUrl = canvas.toDataURL('image/png');
                            
                            // Check if the PNG version is smaller than the JPEG version
                            if (pngDataUrl.length < dataUrl.length) {
                                dataUrl = pngDataUrl;
                            }
                        }
                        
                        // Calculate the file size
                        const fileSizeKB = Math.round(dataUrl.length / 1024);
                        
                        // Check if the file size is within the desired range
                        if (fileSizeKB <= maxSizeKB) {
                            compressedFile = dataUrl;
                            break;
                        }
                        
                        // Reduce dimensions for further compression
                        scaleFactor *= 0.9; // Reduce dimensions by 10%
                        
                        // Adjust canvas dimensions
                        canvas.width *= scaleFactor;
                        canvas.height *= scaleFactor;
                        ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
                    } while (scaleFactor > 0.1); // Stop when scale factor is too low
                    
                    // Callback with the compressed image
                    callback(compressedFile);
                }
                img.src = event.target.result;
            }
            reader.readAsDataURL(file);
        }
        
        // Example usage:
        function handleFileInput(inputId, event) {
            const file = event.target.files[0];
            const maxSizeKB = 200; // Maximum file size in KB
            
            // Compress the file
            compressImage(file, maxSizeKB, function(compressedFile) {
                // Do something with the compressed file, like displaying it
                const img = document.createElement('img');
                img.src = compressedFile;
                document.body.appendChild(img);
            });
        }
        
        // Add onchange event listeners to file inputs
        document.getElementById('frontIDProof').addEventListener('change', function(event) {
            handleFileInput('frontIDProof', event);
        });
        document.getElementById('backIDProof').addEventListener('change', function(event) {
            handleFileInput('backIDProof', event);
        });
        document.getElementById('profilePhotoFile1').addEventListener('change', function(event) {
            handleFileInput('profilePhotoFile1', event);
        });
        document.getElementById('profilePhotoFile2').addEventListener('change', function(event) {
            handleFileInput('profilePhotoFile2', event);
        });
        document.getElementById('profilePhotoFile3').addEventListener('change', function(event) {
            handleFileInput('profilePhotoFile3', event);
        });
  
  //Image resize code ends  
  
  function readURL1(input) {
    if (input.files && input.files[0]) {
    
      var reader = new FileReader();
      reader.onload = function (e) { 
        document.querySelector("#img1").setAttribute("src",e.target.result);
      };

      reader.readAsDataURL(input.files[0]); 
      document.getElementById("img1").style.display = "block";
    }
  }
  
    function readURL2(input) {
    if (input.files && input.files[0]) {
    
      var reader = new FileReader();
      reader.onload = function (e) { 
        document.querySelector("#img2").setAttribute("src",e.target.result);
      };

      reader.readAsDataURL(input.files[0]); 
      document.getElementById("img2").style.display = "block";
    }
  }
  
    function readURL3(input) {
    if (input.files && input.files[0]) {
    
      var reader = new FileReader();
      reader.onload = function (e) { 
        document.querySelector("#img3").setAttribute("src",e.target.result);
      };

      reader.readAsDataURL(input.files[0]); 
      document.getElementById("img3").style.display = "block";
    }
  }
  
    function readURL4(input) {
    if (input.files && input.files[0]) {
    
      var reader = new FileReader();
      reader.onload = function (e) { 
        document.querySelector("#img4").setAttribute("src",e.target.result);
      };

      reader.readAsDataURL(input.files[0]); 
      document.getElementById("img4").style.display = "block";
    }
  }
  
    function readURL5(input) {
    if (input.files && input.files[0]) {
    
      var reader = new FileReader();
      reader.onload = function (e) { 
        document.querySelector("#img5").setAttribute("src",e.target.result);
      };

      reader.readAsDataURL(input.files[0]); 
      document.getElementById("img5").style.display = "block";
    }
  }
  
    function enableDisableButton() {
    if (document.getElementById('terms').checked == 0) {
      document.getElementById('regBtn').disabled = true;
    } else {
      document.getElementById('regBtn').disabled = false;
    }
  }
  
  </script>

New way props receiving in Class Component in React.js

import React, { Component } from 'react';

class MyComponent extends Component {
    render() {
        // Accessing props
        const { name, age } = this.props;

        return (
            <div>
                <h1>Hello, {name}!</h1>
                <p>You are {age} years old.</p>
            </div>
        );
    }
}

export default MyComponent;

Is correct way to receiving the Props in the class component in the react.js ?

I’m trying to test a specific validation case with chai, mocha and sinon, but i get an error: TypeError: expect(…).to.be.true is not a function

Issue Testing Validation Scenario in Controller Layer

I’m encountering an error while testing a validation scenario in my controller layer. The scenario involves checking for the absence of a ‘name’ field in the request body. Here’s the test code:

it('Testing a case of absent name on req body', async function () {
    const req = { body: {} };
    const res = {
      status: sinon.stub().returnsThis(),
      json: sinon.spy(),
    };

    await productsController.insertProduct(req, res);

    expect(res.status.calledWith(400)).to.be.true();
    expect(res.json.calledWith({ message: '"name" is required' })).to.be.true();
});

The controller logic being tested is as follows:

if (!name) {
    return res.status(400).json({ 
      message: '"name" is required', 
    });
}

However, upon running the test, I encounter the error:

TypeError: expect(...).to.be.true is not a function
at Context.<anonymous> (tests/unit/controllers/products.controller.test.js:41:50)

How can I resolve this error and ensure my test for the absence of the ‘name’ field functions correctly?


How to execute a script after the component load in Lit-Element

I’m trying to add a prefix to the phone number input after the component load, but I’m getting an error. In a normal web component, the connectedCallback() method would be enough but here it doesn’t seem to work. How can I fix this?

The error I’m getting:
Uncaught TypeError: Cannot read properties of null (reading ‘getAttribute’)

import { LitElement, html } from "https://cdn.jsdelivr.net/gh/lit/dist@3/core/lit-core.min.js";
import "https://unpkg.com/[email protected]/build/js/intlTelInput.min.js";
import { formattedArray } from "./countries.js";

export class Form extends LitElement {
  static properties = {
    name: {},
    modalContent: {},
  };

  constructor() {
    super();
    this.countries = formattedArray;
  }

  render() {
    return html`
      <form class="flex flex-col gap-3" @submit=${this.handleSubmit}>
        <input type="text" class="form-control" placeholder="First name" name="first_name" />
        <input type="text" class="form-control" placeholder="Last name" name="last_name" />
        <input type="text" class="form-control" placeholder="Address" name="address" />
        <input type="text" class="form-control" placeholder="Zip Code" name="zip" />
        <input type="text" class="form-control" placeholder="City" name="city" />
        <select class="form-control" name="country">
          ${this.countries.map(country => html`<option value="${country}">${country}</option>`)}
        </select>
        <input type="tel" class="form-control" placeholder="Phone" name="phone" id="phone" />
        <input type="email" class="form-control" placeholder="Email" name="email" />
        <button type="submit" class="btn btn-primary">
          Continue
        </button>
      </form>
    `;
  }

  connectedCallback() {
    super.connectedCallback();
    // Initialize intlTelInput
    const input = document.querySelector("#phone");
    window.intlTelInput(input, {
      initialCountry: "auto",
      separateDialCode: true,
      utilsScript: "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/js/utils.js", // Add the correct path to utils.js
    });
  }

  handleSubmit(event) {
    event.preventDefault();

    const formData = new FormData(event.target);
    const formObject = Object.fromEntries(formData.entries());

    // Do something with the form data, for example, log it
    console.log("Form data:", formObject);

    this.dispatchEvent(new Event('submitted', {bubbles: true, composed: true}));
  }

  createRenderRoot() {
    return this;
  }
}

customElements.define("custom-form", Form);

Angular 14 popup video play after closing the popup video play in background

I am working on Angular 14. I have a button. When user click on button i am showing the video in popup modal. But when i click on outside of the popup the popup is closing but video is keep playing in background how to resolve issue:

I have added this code in the page builder for playing video in the popup

component.html

<div class="intro-video">
<div class="hepVideos">
  <label>Learn More : </label>
  <img data-toggle="tooltip" title="Help Video" (click)="videoPlay()"
    src="../../../assets/videos/absenceblueprint_thumbnail.png" class="help_thumbnail" />
</div>
<div *ngIf="isVideoActive === 'false'" class="modal fade" [ngClass]="{'show': isHelpVideoActive}" id="myModal"
  tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"
  [ngStyle]="{'display': isHelpVideoStyle}">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-body">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close" (click)="closeHelpVideo()">
          <span aria-hidden="true">&times;</span>
        </button>
        <div class="embed-responsive embed-responsive-16by9" id="embed-responsive-item">
          <video #videoPlayer id="video-player" width="640" autoplay height="360" controls preload="metadata"
            [src]="videoSource" loop >
            <track id="video-track" label="English" kind="subtitles" srclang="en"
              src="../../../assets/videos/subtitles.vtt" default>
          </video>
        </div>
      </div>
    </div>
  </div>
</div>

component.ts file

closeHelpVideo(): void {


const video: HTMLVideoElement = this.videoPlayer.nativeElement;
var listaFrames: any = document.getElementById('video-player');
var trackFrame: any = document.getElementById('video-track');



let videoFrame:any = document.querySelectorAll("video");

localStorage.setItem('hideWatchVideos', 'true');

this.isHelpVideoActive = false;
this.isHelpVideoStyle = 'none';

this.videoPlayer.nativeElement.pause();
this.videoPlayer.nativeElement.currentTime = 0;
this.videoPlayer.nativeElement.muted = true;
this.videoPlayer.nativeElement.autoplay = false;
this.videoPlayer.nativeElement.loop = false;
// this.videoPlayer.nativeElement.currentSrc = null;
// this.videoPlayer.nativeElement.remove();
this.videoPlayer.nativeElement.load = false;
// video.currentSrc  = "";
listaFrames.audio = false;
listaFrames.loop = false;
// listaFrames[0].currentSrc = "";
videoFrame[0].src ="";
videoFrame[0].pause();
videoFrame[0].muted = true;

listaFrames.remove();
listaFrames.pause();   

this.videoSource = "";
// listaFrames.src = "";
// listaFrames.removeAttribute('src');
// listaFrames.load();
// listaFrames.pause();


listaFrames.currentTime = 0;
listaFrames.pause();
listaFrames.removeAttribute('src'); // video.src = '' works so this line can be deleted
// listaFrames.load();
listaFrames.src = '';
listaFrames.srcObject = null;
listaFrames.remove()

// trackFrame.pause();
trackFrame.removeAttribute('src'); // video.src = '' works so this line can be deleted
// trackFrame.load();
trackFrame.src = '';
trackFrame.srcObject = null;
trackFrame.remove()

}

horizontal roullete fix bugging,displaying countdown and more

SO I was trying to make a horizontal roullete but there are few things i dont understand,btw i am begginger so no hate pls,how do i make an countdown for roullete so countdown for exemple of 15 s starts after every spin is done,and how do i display it,how do i create possibility to bet on number,collor and to make roullete give parametar and how do i make roullete not bugging,it starts spinning and then just show some number,like animation is bugged idk…
here is my js:

$(document).ready(function() {
    // Setup multiple rows of colours, can also add and remove while spinning but overall this is easier.
    initWheel();
    
    // Start automatic spinning every 15 seconds
     setInterval(function() {
        var randomOutcome = Math.floor(Math.random() * 15) + 1; // Random number between 1 and 15
        spinWheel(randomOutcome);
    }, 15000);

    $('button').on('click', function() {
        var outcome = parseInt($('input').val());
        spinWheel(outcome);
    });
});

function initWheel() {
    var $wheel = $('.roulette-wrapper .wheel'),
        row = "";
    
    row += "<div class='row'>";
    row += "  <div class='card red'>1</div>";
    row += "  <div class='card black'>14</div>";
    row += "  <div class='card red'>2</div>";
    row += "  <div class='card black'>13</div>";
    row += "  <div class='card red'>3</div>";
    row += "  <div class='card black'>12</div>";
    row += "  <div class='card red'>4</div>";
    row += "  <div class='card green'>0</div>";
    row += "  <div class='card black'>11</div>";
    row += "  <div class='card red'>5</div>";
    row += "  <div class='card black'>10</div>";
    row += "  <div class='card red'>6</div>";
    row += "  <div class='card black'>9</div>";
    row += "  <div class='card red'>7</div>";
    row += "  <div class='card black'>8</div>";
    row += "</div>";
  
    for(var x = 0; x < 29; x++) {
        $wheel.append(row);
    }
}

function spinWheel(roll) {
    var $wheel = $('.roulette-wrapper .wheel'),
        order = [0, 11, 5, 10, 6, 9, 7, 8, 1, 14, 2, 13, 3, 12, 4],
        position = order.indexOf(roll);
            
    // Determine position where to land
    var rows = 12,
        card = 75 + 3 * 2,
        landingPosition = (rows * 15 * card) + (position * card);
    
    var randomize = Math.floor(Math.random() * 75) - (75/2);
    
    landingPosition = landingPosition + randomize;
    
    var object = {
        x: Math.floor(Math.random() * 50) / 100,
        y: Math.floor(Math.random() * 20) / 100
    };
  
    $wheel.css({
        'transition': 'transform 10s cubic-bezier(0,' + object.x + ',' + object.y + ',1)', // Adjusted transition duration to 10s
        'transform': 'translate3d(-' + landingPosition + 'px, 0px, 0px)'
    });
  
    setTimeout(function(){
        $wheel.css({
            'transition': '', // Removed transition properties to reset
        });
        
        var resetTo = -(position * card + randomize);
        $wheel.css('transform', 'translate3d(' + resetTo + 'px, 0px, 0px)');
    }, 10 * 1000); // Adjusted reset timeout to match the transition duration
}

i tried using ai but yeah…

App development which framework to use for development [closed]

I am learning Java right now and want to do app development,but for cross development apps I need to learn react native or flutter as I have heard that demand for flutter is falling so I thought to learn react native but as it’s uses javascript so I am pretty confused right now
Please help me with your suggestions

I am expecting someone to give some clarity about what should I do , roadmap for that and it’s future demands.

How to properly interrupt a Readable stream before end using async iterators

Node.js v20
I have a Readable stream obtained from a call to a database. I am creating an async iterator from this stream, but I don’t want to iterate all the data. If a certain condition is true, I want to interrupt reading data from the stream before the stream has reached the end. The problem is that I am always getting an AbortError or a ERR_STREAM_PREMATURE_CLOSE error if I call stream.end() manually:

import {pipeline} from 'stream/promises';
import {createWriteStream} from 'fs';

async function* myGenerator() {
    const stream = await someCalltoDb();

    stream.on('error', (err) => {
        console.log('[STREAM ERROR]', err);
    });

    let stop = false;

    for await (const rows of stream) {
        for (const row of rows) {
            const jsonRow = await row.json();

            if (condition) {
                stop = true;
                // stream.end(); // --> This causes ERR_STREAM_PREMATURE_CLOSE instead
                break;
            }

            yield jsonRow;      
        }

        if (stop) {         
            break;
        }

    }
}

(async () => {
    const iterator = myGenerator();
    const outputStream = createWriteStream('output.txt');
    await pipeline(iterator, outputStream);
})();

enter image description here

What is the correct way of partially consume a stream in an async iterator?

Why Ajax post method is not connecting to the php page “view.php” and always the error part of the response is the output

I have id taken from an html element and i want to use it in my php page, so i cross it to php page using post method but it seems to be not working in my case. And everytime the error part of the response is executing and not succeeding.


// product fetching from database 

  $(document).ready(function(){
    $('.brand').click(function(e){
        e.preventDefault();
        var brandId = $(this).attr('id');
        alert(brandId);
        $.ajax({
            url: 'view.php',
            type: 'POST',
            data: {'brandId': brandId},
            
            success: function(response){
                $('.janvi').html(response);
            },
            error: function(){
                $('.janvi').html('Error fetching products.');
            }
        });
        
    });
});

<?php
// Database connection settings
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "customer";

echo("hi");


// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
echo("hi");
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

// Retrieve brand ID from AJAX POST request
$brandId = $_POST['brandId'];
echo("hi");
// Fetch products based on brand ID from the database
$sql = "SELECT * FROM productdetail WHERE name = '$brandId'";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    // Output data of each row
    while($row = $result->fetch_assoc()) {
        echo "<p>" . $row["name"] . "</p>";



    }
} else {
    echo "No products found for this brand.";
}

// Close connection
$conn->close();
?>

I tried to get the data brandId to php page for further usage using post method but it seems not be working .

npm live-server issue with updating simple CSS file

I have this very simple HTML file with a seperate CSS. It’s the most basic code (there is no error in the code i can guarantee that). When I go in VS Code and type in the terminal “live-server” then the live-server starts normally and it seems to work fine when I edit my HTML page ( it refreshes the page after I save my HTML with ctrl + S). But when I try to update my CSS and save it, the page wont update the CSS changes. They get only updated when I update the .HTML file as well, which is not the expected behavior and annoying. Inside the Terminal in VSC everything looks normal when I change anything:
“Change detected C:UsersWorkstation#Documentscomplete-javascript-course-mastercomplete-javascript-course-master4-HTML-CSSindex.html
CSS change detected C:UsersWorkstation#Documentscomplete-javascript-course-mastercomplete-javascript-course-master4-HTML-CSSstyle.css”.
I looked in the Console in Chrome and it returns me this Error when updating the CSS with live-server:

Uncaught DOMException: Failed to execute ‘removeChild’ on ‘Node’: The node to be removed is not a child of this node.
at refreshCSS (http://127.0.0.1:8080/:45:11)
at socket.onmessage (http://127.0.0.1:8080/:59:40)

This error doesn’t occur when I update the HTML. But as I said, when I update the CSS and then the HTML too, then the CSS changes will be visible.

I tried to change live-server settings in VSC, but seems like they don’t apply to node.js live-server but only to the live-serve from the in-built VSC extensions.