Questions tagged [javascript]

For questions about programming in ECMAScript (JavaScript/JS) and its different dialects/implementations (except for ActionScript). Note that JavaScript is NOT Java. Include all tags that are relevant to your question: e.g., [node.js], [jQuery], [JSON], [ReactJS], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

Set variable resetting upon function call

I have a set declared outside of a function in React.js, however after adding elements to the set in a function, none of the elements are retained once the function is called again. App.jsx import ...
Nawfal Cherkaoui Elmalki's user avatar
0 votes
0 answers
4 views

How to reliably intercept (and cancel) all the input in contenteditable?

I need to catch all the input in my contenteditable element and process the input in the code. Basically, what I need is to prevent input event from changing data in element and to know what data was ...
Andrew's user avatar
  • 731
1 vote
1 answer
15 views

What is the point of Lodash's `_.ary` function?

What is the point of Lodash's _.ary function? The example given is... _.map(['6', '8', '10'], _.ary(parseInt, 1)); ... and I can see that this is helpful because map calls the callback function with ...
Daniel Schilling's user avatar
0 votes
1 answer
13 views

React use hook inside eventListener

I have created the following hook to play audio in react: "use client"; import { useEffect, useState } from "react"; export const useAudio = (url: string) => { const [...
JaRoMaster's user avatar
-2 votes
0 answers
28 views

Class returning NAN when it is a number [closed]

I am trying to make a object point towards the mouse cursor and move towards the angle it is facing. For some reason the moveSteps() function changes the entire class object to NAN. I tried setting ...
UnrealPuggy's user avatar
0 votes
0 answers
6 views

Adding Time Slots to Weekly and Daily Views in WPSP School Management System Plugin

I'm using the WPSP School Management System plugin in WordPress, and I'd like to add time slots to the Week and Day views of the calendar. Can you assist with this development task? I tried to edit ...
Nokhaiz Ishaq's user avatar
-1 votes
0 answers
10 views

Adding a custom page to Word press (css, js, html & images)

I recently have gotten into Web "development". I created a wordpress site and have it all fine and dandy with a theme I picked out. I then created my own different page (that I intend to ...
Kyle Pereira's user avatar
-1 votes
0 answers
9 views

How to access headers(network) information through the browser console?

I am logged into an application that generates a new token (Bearer) daily. I need this token to make requests (GET, POST). However, I don't want to fetch it manually by accessing the network in ...
Joarle Mafra's user avatar
0 votes
0 answers
12 views

Rotating a small image on a background image places the small image in the wrong location

const cCanvas = document.getElementById('canvas'); cCanvas.width = 600; cCanvas.height = 300; const cContext = cCanvas.getContext('2d'); const cBackgroundImage = new Image(); const ...
ttom's user avatar
  • 987
0 votes
0 answers
5 views

dynamic import failing in react-native, throws "unknown module" error

I am attempting to use Reactotron and so I followed the quick start instructions found here: https://github.com/infinitered/reactotron/blob/master/docs/quick-start-react-native.md however although I ...
Pj Fani's user avatar
  • 11
0 votes
0 answers
13 views

How do I access an object retrieved from a fetch globally? [duplicate]

I have an example js file that will log an object inside of a function that calls the fetch, but I want to be able to access an object outside of the function so I can get values in various places on ...
irjeffb's user avatar
0 votes
0 answers
15 views

Unable to draw a pixel or oval circle using JavaScript

I am trying to draw pixel circle but need help with few issues: When the width and height of the grid are not even, it should draw an oval shape but it's not and it leaves empty cells along the grid ...
Sysads Gazette's user avatar
1 vote
0 answers
20 views

DataTable column names is invisible in header of table

The data table is shown correctly but DataTable column names are invisible in header of table but accordingly to this link [example] there are no mistakes. Which way possible to show column names? ...
Artem Redko's user avatar
0 votes
0 answers
12 views

Duvida com GitHub - Sobre repositórios e organização para trabalho em equipe [closed]

Estou iniciando um novo projeto no github que sera para um trabalho em grupo, estou em duvidas sobre a organização, devo criar um repositório para cada area? Exemplo: Repositorio para Front-end, outro ...
Kauan Alexander's user avatar
-2 votes
0 answers
17 views

In my controller's update action, when update_attributes fails due to the validator, I lose the /edit suffix in my URL

Description of my work environment: Rails 4.2.4, Ruby 2.3.1, SQL Server database, javascript on object html views My controller that content an update action: if @cs.update_attributes(...
Shyden's user avatar
  • 1
1 vote
0 answers
5 views

MessageChannel ports variable is empty array

I've the following snippet that trying to send message to inner iframe: const { port1, port2 } = new MessageChannel(); port1.addEventListener('message', ({ data }: MessageEvent) => res(data)); ...
Ballon Ura's user avatar
0 votes
0 answers
14 views

mouse-scrolling an element inside shadowRoot does not work in chrome

I have a div inside a shadowRoot that has a fixed height and overflow set to auto. The content is larger than the box and therefor scrollbars appear. When the (outer) page allready has scrollbars it ...
stalet's user avatar
  • 1,345
0 votes
0 answers
7 views

JSConfig for SmartBear TestComplete for Intellisense, Autocomplete and JSDoc documentation support in VSCode

My team is using TestComplete for test automation and the scripts are written in Javascript. The built-in editor is severely lacking and doesn't support autocomplete with module imports (require ...
Charles Coulter's user avatar
0 votes
3 answers
41 views

Prevent double click React

Hello everyone im trying to prevent double click but im not doing any API calls, and dont want to use timeout I did few approachs first one import React, { useState } from "react"; const App ...
Neo's user avatar
  • 477
-2 votes
0 answers
17 views

React QuerySelector returns null on first call (after that everything is fine)

document.querySelector returns null on lines 37 and 38 (I've marked these lines in the code so you don't have to look for them), when pressed for the first time, and then returns the desired value and ...
Dmitry Iordanov's user avatar
0 votes
0 answers
8 views

Display number of items in list filtered with AlpineJS

I have a system of filters that can be applied to a list of images. I use AlpineJS to keep only the items to be displayed when a filter is active. Everything works fine but I'm having a problem ...
DamsFX's user avatar
  • 21
0 votes
0 answers
9 views

How to use lightgallery library on my website

I accidentally found an image slideshow library (lightgallery) from a website, however I am not a good expert in javascript and open source. I want to use this slideshow library for my blogger, ...
RichardDoan's user avatar
-3 votes
0 answers
37 views

How do I add a variables value to an array? [closed]

I need to add a string of letters to a array then change the strings value and then add the new value to the array. Then after all that console.log the values back to me. let number = Math.floor(...
Viper_shot's user avatar
-1 votes
0 answers
11 views

Nextjs 13 hosted on vercel , functionalities not working on IOS, but they work in chrome (windows & android)

I have a web app hosted on vercel which is created in nextjs 13 - react, When tested with functionalities my application is fully functional on chrome - windows and andriod, but on safari nothing is ...
Shubham prajapati's user avatar
-2 votes
0 answers
13 views

Import from external URL in JS file [duplicate]

I want to display a .glb image on a web page so I use three.js library. HTML-file of the web page: <!DOCTYPE html> <html> <head> <title>...
Jisoo Kim's user avatar
0 votes
0 answers
17 views

update array of obj in react crud app using array methods

I am trying to build a crud app with react , i have completed create and delete parts , when I am trying to make update part having some issues getting current item from array of objects and update ...
Meta Boost's user avatar
-4 votes
0 answers
27 views

How to format Hours Minutes Seconds Milliseconds from GMT date format? [closed]

I need to get hours minutes seconds milliseconds from below code . const curDt = new Date() const curGmtDt = curDt.toUtcString() i tried with momentjs , but it always return a same value const ...
Elamparithi.P's user avatar
0 votes
1 answer
19 views

jquery autocomplete add class name list

I'm trying to add a class to each variable that gets found. As you can see, in the label, the variable 'airport name' will have one class, and 'country' will have another class. So, after, I can apply ...
jAY's user avatar
  • 1
0 votes
0 answers
5 views

Typeorm initialize DataSource Error, Econnrefused

This is my DataSource in Typeorm: export const AppDataSource = new DataSource({ type: "postgres", host: "localhost", port: 5432, username: "test", password: "test", ...
Bigbool98's user avatar
0 votes
0 answers
36 views

how do i find if an number is decimal? [closed]

I want it to alert Interger if x is an interger and alert decimal when x is a decimal let x = prompt("x") if (x = 0){ alert("x = 0") } else if (x == Math.floor(...
vheit's user avatar
  • 1
-1 votes
0 answers
16 views

Trouble Displaying PostgreSQL bytea Images in React: Image Source URL Not Working

I am working on fetching the images from a PostgreSQL database. These are stored as bytea in the PostgreSQL database. When I fetch it from the API, it has type object and it looks like: { 'type': '...
Razvan's user avatar
  • 141
0 votes
1 answer
22 views

'click' event retaining changes even after clicking is done

Why does the flexbox not turn back to black after a click is done? If I'm not wrong, the box should be blue just for an instance while using click event right? However the colour is permanently ...
Manav Ganesh's user avatar
-1 votes
0 answers
14 views

TypeError: Cannot read properties of undefined (reading 'passport')

Good day developers, I'm currently doing a project that will need me to show my users profiles from database but I encounter a problem. I'm using expressjs and mongoDB as my database. I will be ...
Francis 's user avatar
0 votes
0 answers
8 views

How can I fix an error in a Quasar Application when I using LangChain's CharacterTextSplitter

I have the a Quasar application using 2.3 that is using the latest build of OpenAI (4.10) that is giving me an error if I try use LangChain's Textloader I'm also using node 16+ import { ...
Bill's user avatar
  • 1,423
-4 votes
0 answers
23 views

Selecting a specific date in a Calendar popup when two 30 is available in the popup [closed]

My problem is in the image added calendar popup is having 30 date twice so my code is selecting may 30th 23 instead of June 30th 2023 var Date = <passedDate>; var Temp = Date.split("-"...
Surya Singh's user avatar
-1 votes
0 answers
32 views

find K points with the largest distance in a sorted array [closed]

Suppose we have a sorted array with numbers: (the difference between 2 consecutive numbers does not have to be the same) A=[1,2,3,4,5,100,200,200,1000,1500,1501] What is the most efficient way to find ...
complex_stock 's user avatar
0 votes
2 answers
38 views

React type error while setting the boolean value

I am trying to set a boolean value using a setEditMode function but unfortunately, I am encountering with a type error while invoking the component in index.tsx file. The error is Type 'boolean' is ...
ninja's user avatar
  • 197
0 votes
0 answers
24 views

Following a tutorial but receiving object.value error [closed]

So I'm following along with this tutorial - https://www.youtube.com/watch?v=Bu0jT7xmdqI and thus far every issue I have ran into I've been able to troubleshoot myself but this I can't understand. His ...
ydaq's user avatar
  • 1
0 votes
0 answers
13 views

How to pull multiple sub-table data as a single table data in Javascript with Cheerio

I want to download the whole table data from this webpage. It has five sub tables having its own thead and tbody each, under 'table[class="calendar"]'. My codes below can pull all thead ...
Newbie's user avatar
  • 247
0 votes
0 answers
23 views

Refresh of grouped data not rendered even if server response is correct

I load data from database and I see this in my table This is an example of JSON data of my database, I have 4 columns, table is called user [ { "badge": "ebooks", ...
Alex Doc's user avatar
  • 167
1 vote
0 answers
17 views

How to Replace "url says" with "name of web application says" in JavaScript Error Pop-Up

I'm encountering an issue with JavaScript error messages displayed in my web application. Specifically, I want to replace the "url says" part of the error pop-up with "name of web ...
user1171287's user avatar
0 votes
0 answers
18 views

HeatMap in Open Layers with function instead of url

Today I use open layers to load heat points on a map. I use the following code: It uses a physical file to load these hot spots, where every time I need to create the file and then delete it. I would ...
Ribak's user avatar
  • 119
0 votes
0 answers
16 views

Initial value of state in useReducer not warking properly

I have problem when i initiate state in useReducer using localstorage AuthContext.jsx import { createContext, useReducer, useEffect } from "react" import jwt from "jwt-decode" ...
Tko Code's user avatar
-3 votes
3 answers
47 views

Javascript recursive function error can't iterate undefined [duplicate]

When I run this script the error says "TypeError: flattenArray(...) is not iterable (cannot read property undefined)" When I'm using a recursive function to flatten an array, there are ...
David's user avatar
  • 51
1 vote
2 answers
34 views

Regex to match markdown headings and text nested under specific heading

I am using Obsidian (which uses ECMAScript) with the Obsidian_to_Anki-Plugin and I have this page structure: # Heading 1 ⤵ ## Heading 1.1 Text of Heading 1.1 Text can span over multiple lines Even ...
lukaskupfing's user avatar
0 votes
1 answer
9 views

Implementing Aws Map in react Ui getting Uncaught ReferenceError: _wrapNativeSuper is not defined

I am trying to Implement Maps in my React website , I am not sure why map is not rendering in my web and getting - Uncaught ReferenceError: _wrapNativeSuper is not defined this error , here is my code ...
Abi.D's user avatar
  • 1
0 votes
0 answers
13 views

Highcharts in Jupyter Notebook Throws Highcharts.js script error while trying to display the charts

I'm trying to replicate one of the highchart's demos in my local anaconda Jupyter notebook (windows 10 machine), and while trying to display the chart, it throws a Highcharts.js script load error. ...
VIJU's user avatar
  • 5
1 vote
0 answers
23 views

Set relation inside items.create or items.update hook

I use Directus 10.6.2 and I'm currently working on a hook extension where I want to do some data wrangling when importing data via CSV. When importing items in my products collection I want to allow a ...
Hermann Dettmann's user avatar
0 votes
0 answers
14 views

Parsing IMDB movie connections page with load more button

I'm trying to parse imdb movie connections (https://www.imdb.com/title/tt0090887/movieconnections/), but more button don't load info. I'm using got-scraping as HTTP-CLIENT and cheerio as parser, but I'...
Victor Fernandez's user avatar
-4 votes
0 answers
22 views

I need to write a full-stack online store in Javascript, the rest of the technology is optional [closed]

I need to write a full-stack online store in JavaScript, the rest of the technology is optional. I'm looking for a good guide, sources, tips that will help me build it from scratch step by step, I don'...
Kacper Di Leva's user avatar

1
2 3 4 5
50275