Questions tagged [javascript]

For questions about programming in ECMAScript (JavaScript/JS) and its different dialects/implementations (except for ActionScript). Keep in mind that JavaScript is NOT the same as Java! Include all labels 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
1 answer
14 views

How to use the ready slider (slick)

I want to use a ready-made slider in the form of a WordPress site that I have designed for myself. For this purpose, I have used the following site ready sliders: https://kenwheeler.github.io/slick/ I ...
  • 226
0 votes
1 answer
15 views

Empty match on end token due to greedyness

I want to parse the space around items of a comma-separated list (the indices are the interesting part for me). Imagine parsing the arguments of a function call. I'm using the regex ^\s*|\s*,\s*|\s*,?\...
0 votes
0 answers
4 views

How to differentiate between System Audio and Microphone Audio in Javascript?

I'm developing an electron app with react. I have a functionality in which I want to record audio for both microphone and system and send them to backend in different variables. For that, I have used ...
  • 358
0 votes
0 answers
11 views

Only last row is being inserted into database instead of all the rows? Javascript

$(document).on("click", "#devSaveBtn", function () { var answer = window.confirm("Save changes"); if (answer) { // ! -------Gets the input from record row-------- // * Table variable ...
0 votes
0 answers
6 views

Return audio file collected from external url with ExpressJS

I retrieve an audio data from an external url and I need to return audio with an api call. When I go to that endpoint like http://localhost:3000/audio from browser, I need to listen to that audio. I'...
0 votes
0 answers
15 views

Node.js file loading difference between .load and cli arguments

I'm writing a simple server in vanilla JavaScript and Node.js. I made a database.js file which contains abstractions to interact with my database (redis). I want to automatically set n_users and ...
1 vote
1 answer
14 views

How to store a File object to local storage and retrieve it

I am converting a blob image to a File object, uploading to local storage and retrieving it, but when i retrieve it the file object isn't in the format i expect. I am converting a blob image to a file ...
  • 915
0 votes
0 answers
5 views

why built in method to getcurrentposition not working on my website

i put in a code to my browser and this code working in my liveserver, but don't wanna working on my website i have hosting from infinitefree: const bat = document.querySelector('.location') const ...
0 votes
0 answers
8 views

Joi: Validating an object containing a property whose value is an object with dynamic keys

I am attempting to create a response schema for a payload that looks something like this: { ... property: { nestedProperty0: { 'cd9d3cc3-de1d-4f89-a7d3-7bf6838481da': '...
0 votes
0 answers
3 views

How to add Yandex metric in a nuxt.js 2 project and send setUserId?

Can you please tell me how to add a metric to a project written in nuxt.js version 2 and send setUserId and other targets? I tried vue-yandex-metrika and nuxtjs/yandex-metrika but they don't provide ...
  • 1
-1 votes
0 answers
10 views

Change month to react date picker

When creating a custom header, functions are available to us increaseMonth() and decreaseMonth(). Is there any way to switch the month outside the header? As I understand it is impossible to implement ...
0 votes
1 answer
30 views

How to align thead and tbody for an HTML table

I am trying to create a scheduler table and I can not align the rows in the table header thead > tr with the rows in the table body tbody > tr. Any advice on how I can do this would be much ...
  • 199
-1 votes
0 answers
13 views

Não consigo inserir, cadastrar e salvar a placa, nome e montadora na tabela do JSON em JavaScript [closed]

Falta implementar: informar um novo carro, lista dos carros, chamar a função adicionarCarro. Tabela do JSON: (index) │ placa │ nome │ montadora │ ├─────────┼───────────┼─────────┼─────────────...
0 votes
2 answers
12 views

Error: Uncaught TypeError: Failed to resolve module specifier "@aws-sdk". Relative references must start with either "/", "./", or "../"

I am trying to retrieve an api key that I stored in AWS, I have installed the package using NPM and initialized the project with npm init, the package.json contains the dependency, and I also check ...
0 votes
0 answers
17 views

Pixel-Perfect text stroke calculation

in the screenshot of a project I did in the past, I added a stroke around the text very nicely. But when I do it with -webkit-text-stroke, it starts to break after a level: But in my previous code, I ...
  • 72
0 votes
0 answers
12 views

How do I select this class in puppeteer?

Keep in mind I need it to specifically grab the custom-body-copy class along with the body copy class as there are hundreds of body-copys on the page. <div class="row item-row" id="...
0 votes
0 answers
13 views

Run time-consuming function with Promises without blocking runtime [duplicate]

I'm trying to understand how to use time consuming function with Promises. I have some nonsense, but time consuming function computation() (that I create for demonstration purpose), that would need 3-...
0 votes
2 answers
19 views

Div with display set to none still registering click events

I have attempted to make a dropdown menu using pure HTML, CSS, and js, yet I have encountered a problem. When the menu is closed and i click close below it, it thinks I'm clicking the options inside ...
  • 25
0 votes
0 answers
9 views

Where is the right place to set axios.defaults.baseURL in a NextJS application

I would like to setup axios base url in a NextJS application. Currently I have this setup in the _app.js file. axios.defaults.baseURL = 'https://api.example.com'; I would like to know if this is the ...
  • 7,397
0 votes
1 answer
10 views

Getting an channel by its ID then sending an message into it

I am trying to get an channel by its ID then send an message into it. But I am receiving an error when the code is executed. ERROR: Error sending message to welcome channel.: TypeError: Cannot read ...
0 votes
0 answers
16 views

Vuetify Custom Dropdown | How to add a custom selection slot

Trying to develop a custom Dropdown which currently looks like this: You can't get it to look like that by default. I had to do some rework in the component and here is the code: Component Code: <...
  • 2,512
0 votes
1 answer
11 views

How to disable parallax effect on mobile (touch) devices?

I have a parallax effect written in JavaScript. This effect swings the picture from side to side. I want to disable it for tablets and mobile devices. My JavaScript code for parallax. let bg = ...
1 vote
1 answer
13 views

Declaring the inputs property within the Angular @Component Decorator?

I'm studying the Angular Material Button code and I noticed that within the @Component there a declared inputs property. What is this for? The description says: inputs - list of class property names ...
  • 39.8k
-1 votes
0 answers
12 views

For loop Javascript failed to display images

I'm a noob in JS and try to do my best to improve my skill but I'm stuck right now and I don't see why... Also, I'm from France and I go out my comfort zone to speak english because it's not clean. So ...
  • 1
0 votes
1 answer
35 views

Why does my CSS style not apply on logo color during scrolling?

I want to change my logo's color after a while during scrolling. Here's the code I've written: window.addEventListener("scroll", () => { const navbar = document.querySelector(".navbar"); ...
  • 1
1 vote
1 answer
21 views

How to calculate if scrollbar will show (recursive problem)

Given a container like this: .container { width: 100px; height: 100px; overflow: auto; } You would expect that either a vertical or horizontal scrollbar will appear if the content width or ...
  • 61.1k
-2 votes
0 answers
16 views

Countdown from all items in Array [closed]

I want to countdown from a Array that has times in it. ["20:30:00","20:31:00"] Example array Firts countdown to 20:30:00 then start the next countdown!
0 votes
0 answers
9 views

Uncaught (in promise) TypeError: Cannot set properties of null (setting 'innerText') [duplicate]

I'm trying to display the content from /terminal/input.txt in the div output. HTML body: <div className="events"> <Navbar /> <p id="output"></p> <...
1 vote
2 answers
34 views

Best method for converting an array of JSON

I have an array embedded in JSON, and i need to convert some elements over to another array in JSON. Is there a better method than iterating over the first to construct the second? products = [{"...
  • 71
0 votes
1 answer
19 views

How to add a separator line to the sent mail with mailto:?

Users can send mail to me in my application. Here is my code: const sendEmail = (text) => { const deviceId = "ad73f832h9214" const body = `${deviceId}\n\n${text}` const url = `...
  • 147
0 votes
1 answer
20 views

JS test can't find html element with assertContains

I have this test in a js file (that I can't change). browser.waitForElementPresent("body", 10000, "Page loaded") .url(browser.launch_url) .waitForElementVisible("body") ....
0 votes
1 answer
18 views

Next.js "Please only return JSON serializable data types." API call from lib

I am trying to make an API call to later display data on a page. Putting the JS function next to the HTML works fine: export default function Post() { const callAPI = async () => { try {...
1 vote
3 answers
45 views

someone knows how to hide the content of an input without being of type password? that is of the email type

`in my work I am asked to hide the content of the input as if it were a password and I don't know what to do. I tried to replace the last letters that came with a * and it worked but if I need to ...
0 votes
0 answers
23 views

Why new Date() constructor returns different timezone for the month February?

I have given unixTimeStamp objects given as below. convertedMonthList stores each unixTimeStamp as Date.Function calculateUnixLocalTime removes timezoneoffset from given date. const dateArray = [ ...
1 vote
1 answer
34 views

Can Element.ClassList.add() function be asynchronous?

I know that classList.add() function is synchronous but if i wrap classList.add() into async function and run it like this: const ca = async function(elem,clss){     elem.classList.add(clss); } await ...
0 votes
1 answer
23 views

Javascript array multiple instances created

I am making a search function for a glossary (a set of divs with class searchable). When the search term is first processed I instantiate the array by const foundset = []; The search is then carried ...
  • 1,291
-1 votes
0 answers
27 views

Split a string while ignoring the bracket content [closed]

I tried creating a Javascript program that can split "4+2(4x+3)+6" into [4, 2(4x+3), 6]. Whenever I run this: let str = "4+2(4x+3)+6"; str = str.replaceAll("+", "++&...
0 votes
0 answers
8 views

Issue importing env variables into edge function

I have a react client connected with supabase. My supabase connection is working correctly, as I have tested normal CRUD functionality between the database tables and the react client. However, I am ...
-1 votes
0 answers
16 views

How do I check if a specific collection on MongoDB contains an object that I am trying to insert into it?

I want to use as little resources as possible for the operation (If that is relevant). PS : I am new to asking questions here. Pls help! I tried finding something for this on the internet but couldn't ...
1 vote
0 answers
10 views

Retrieving value from radio button inside a jinja2 loop and pass it to different forms in flask

I am currently creating a webpage that lists out every grocery items, type, and prices in a table. The data is stored in a mongoDB collection. I also have radio buttons right next to each entry that ...
0 votes
0 answers
7 views

Lume Static Site Generator and Firebase Storage

I have a Lume project with a _data folder containing some calls to Firestore which ends up with an array: Setup: const app = initializeApp(firebaseConfig); const db = getFirestore(app); const storage =...
0 votes
0 answers
3 views

Google App Script - Create Google Calendar Event without duplicates

I am creating a function that creates a calendar event for a row of data when one of the cells is marked with a 'y'. I have it working but every time it runs it creates duplicate events. My work ...
0 votes
0 answers
13 views

Scaling Three.js scene when entering WebXR VR mode

I'm using Three.js to create a virtual environment and I'd like to scale my scene when the user enters VR mode using the WebXR API. I'm using the VRButton provided by Three.js, but I'm not able to ...
  • 350
-3 votes
0 answers
19 views

Javascript Minification [closed]

Can anyone help me to find the tool used to minify the following javascript file: Link to file I want to minify my javascript file like this. Because it uses bracket notation to access keys. And the ...
0 votes
0 answers
12 views

query two parameters mongodb

Has anybody an idea, how I can modify this code in a way so that I can search after either only a title or only a rating or both? I have already tried serveral ways including using the $and operator, ...
0 votes
1 answer
24 views

how can i bind this value to the src attribute in a dynamic image on vue

I'm new with vue and I'm learning so my code can be very simple, and I would like to make a kind of lightbox, my problem is that I don't know how to link the imgSrc attribute to the image that is ...
0 votes
1 answer
28 views

How do I structure a project with separate concerns?

I am working on an app which I am building with React Native so with each new major update I build my app, then upload it to app stores, I also have a Express Server for the same which after every ...
  • 1
0 votes
0 answers
21 views

null is not an object error in simple countdown script

I've a very simple script that displays a countdown in a div, and at the end of the countdown it redirects the page to a URL. It's working fine, but giving a "null is not an object" error. ...
0 votes
0 answers
6 views

How can I ensure the functionality of a JS dropdown menu with iOS devices?

Context: StackOverflow members helped me with some javascript to make a portfolio "data-base" page: basically, multiple artworks in 100+ separate div elements, the divs being filterable by &...
0 votes
0 answers
9 views

handle multiple accounts on one computer with redux to store shopping items in localStorage

I have e-commerce website and I want to handle multiple accounts in one computer like when user switches between different accounts the data which is related to account get shown like shopping carts ...

1
2 3 4 5
49704