Category "javascript"

Filter array on multiple attributes on same key

I have a json and would like to filter for one key multiple attribites as exact match. I tried the following: let data = [{ "name": "Product 2", "li

Inject html with unclosed tags with alpine.js

What is the proper way to inject a portion of html that have unclosed tags? I use the modulus in x-if for determine when close the row and start a new one. This

Angular - Count all dates per month & return month & count array

Basically counting records per month, where each record has a Create Date. Need an array that contains month name + count as variables. Only managed to do it wi

zip and download folders to local using nodejs

How to zip and download folder from D:/downloads path. As a 1st step, I was able to create a folder inside 'downloads' with dummy content. As a next step I want

VUE-js Accessibility for b-spinner -- audio announcement of data loading using Aria that REPEATS every 3 seconds

I am trying to add accessibility for the audio announcement of "data loading" when a spinner is visually showing that the data is loading. Obviously, I am looki

TypeError: Object(...) is not a function (React)

I was following a tutorial on how to add google maps to a react/expo javascript project. I am new to the javascript language and have had a bug that I cannot fi

Replacement of deprecated MediaQueryList.addListener() event in Angular 8

As the mozilla developers docs says MediaQueryList addListener is deprecated. I'm using it in my Angular 8. Though it's working it's linting warning in VS Code

regex - Filter out year from a date string in an array of objects

I'm trying to filter out year out of this array of objects (in React) 2021-12-20, 2021-12-21, 2021-12-22, (...) 2022-01-28, 2022-01-31, 2022-02-01, It has 100

Server Side Rendering for improving SEO of landing page in already existing React + jQuery Website

I have an already existing website that has a pretty huge codebase. It was initially built in jQuery and is currently being migrated to ReactJS so both are used

Why need useRef and not mutable variable?

I have read A Complete Guide to useEffect - Swimming Against the Tide at Overreacted. The example shows that if we want to get the latest count, we can use us

Server Side Rendering for improving SEO of landing page in already existing React + jQuery Website

I have an already existing website that has a pretty huge codebase. It was initially built in jQuery and is currently being migrated to ReactJS so both are used

firebase-ui-auth firebaseui.auth is undefined

I'm trying to get firebase-ui-auth to work. I pasted what the documentation says to paste into my code (Found here): // Initialize the FirebaseUI Widget using F

Is it possible by clicking on Electron's MenuItem of type checkbox not to close the current submenu?

I have in my Electron app the submenu with a couple of MenuItems of type 'checkbox': { label: 'Search settings', submenu: [ {

How to get the component type in <script setup>?

This code comes from the official documentation and does not use defineComponent() to declare components. I tried and failed, and webstorm failed. //App.vue <

Download PDF file form embed tag using Puppeteer

I am trying to download a pdf from a Website. The website is made with the framework ZK, and it reveals a dynamic URL to the PDF for a window of time when an id

Map Dissapearing After Calling JumpTo (MapboxGL + React)

I'm developing a website that takes in an address from a user and plots a list of nearby locations using MapBoxGL and React. When the user runs the search, an A

React navigation 5 really slow and dropping JS FPS on Expo

I am currently working on a React Native (Expo) App and I am facing some performance issues. I have not found any answer yet for my problem so I hope someone ca

webpack-dev-server app doesn't render my html instead I get Cannot GET /

I am trying to run my javascript app with webpack dev server and I don't get my index.html back, instead I get Cannot GET / with this error inside the console G

Why I got empty object on Angular route?

Why I got empty object from ActivatedRoute params and how to fix that? routeId$ = this.route.params.pipe( tap((params) => console.log(params)), // <

Jest test case for React hook component

When I write a react hook component which import '*.png' resource like this: import React, { useState, useEffect } from 'react'; import './topMenu.less'; im