Category "javascript"

Add {NavLink} to React Component Showing Blank Pages

I'm new to React.js and already make new react app using : create-react-app I already install dependency react-router-dom var React = require('rea

javascript/jquery only affects first element

I have this html code for a search form and i would like to use jquery to edit the url to let searchform, searchurl, i; searchurl = window.location.href; s

How I can update code from discord.js v12 to v13? - Welcome messages

I was watching YouTube tutorial about welcome messages. I copied whole code etc. When I'm using this code on discord.js v13 it doesn't work. When I use this cod

Reduce height and vertical padding for a react-native-paper TextInput

I have the following code: import React, { Component } from 'react'; import { View, StyleSheet } from 'react-native'; import { Button, TextInput } from 'react-

How to choose a weighted random array element in Javascript?

For example: There are four items in an array. I want to get one randomly, like this: array items = [ "bike" //40% chance to select "car" //30%

Data Transfer size from server to browser (Data downloaded/bandwidth usage)

I am working on a video streaming application in javascript, i want to tell user how much mbs of data user have consumed/used or how much data has been transf

Object structure visualized in memory

I am trying to picture the way how Javascript object is placed in the memory. Since it is an object, it is stored on the heap part of the memory. It is also a

Create staircase from symbols using javascript

I want to output the staircase from the symbols "#". It should look like this: but all I achieve is this: What should I do to get right output? var n = 6; var

Error below TypeError: Cannot read properties of undefined (reading 'channels')

I have this small problem where I get the Cannot read properties of undefined error, but I don't know where the issue is. Can someone help me with this one? con

How to remember if a method mutates the original array?

I know I can find a list of mutator methods on MDN, still, in practice I always forget if methods like push() or reverse() mutates the original array or creates

How to record a particular tab stream using getUserMedia

I want to record a particular tab (by specifying the tab id) without showing the tab selection dialog from getUserMedia. For this I use mediaSource as browser a

Three.js Texture loading

I am starting during this days with Three.js and it's very cool. Now i would like to load a texture and apply it to a simple sphere. My problem is that when i o

Chrome Extension: How do I inject a script that the user provided?

I'm making an extension for chrome where the user can input a script, then press "run" to inject it into the current tab. I am using MV3 (manifest v3). Are ther

How to handle the render of a large list of items in react?

I have a large list of items to render and list data get updated in realtime with socket-io. How to handle performance issues? it gets updated heavily and table

Reading response headers with Fetch API

I'm in a Google Chrome extension with permissions for "*://*/*" and I'm trying to make the switch from XMLHttpRequest to the Fetch API. The extension stores us

How to place equally spaced svg text in order

I have a svg element generated with javascript, that looks like this <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1

Unable to connect MongoDB server?

I have tried to connect to MongoDB server using the below-mentioned link but I am getting an error, I have entered the correct password and dbName but it couldn

How do I load only this page when my progressive web app goes offline

I'm stuck on a problem: I wanted to make some tests trying to turn my simple flask web application into a progressive web application even tho I found poor info

Multilayer parallax background

I'm looking to do a parallax effect like this. https://medium.com/@PatrykZabielski/how-to-make-multi-layered-parallax-illustration-with-css-javascript-2b56883c3

Using ExcelJS, how to read data from excel file using URL?

I have excel file upload in cloud. Using node js when front end pass URL i need to read data from excel file. Below is my code, var workbook = new ExcelJS.Wor