Questions tagged [javascript]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

1 vote
0 answers
3 views

Model identified during hot reload and only fails after server restart

I am connecting to mongodb via mongoose and then creating a model as follows. // coming from /database/schema import mongoose from "mongoose"; const kittySchema = new mongoose.Schema({ ...
user avatar
  • 4,093
0 votes
0 answers
12 views

form 'isValid' is always false

I am using react, typescript, and Email JS library. I am using the react-hook-form library and yup to validate forms. I am using isValid from the react-hook-form library to see if the form is ...
user avatar
  • 9
0 votes
0 answers
9 views

How to write user data along with image in Firebase

I implement the functionality of adding user data to Firebase. I write the picture to Firebase Storage. Now there is an error - TypeError: Cannot read properties of null (reading 'name'). How can it ...
user avatar
0 votes
0 answers
9 views

JavaScript Puppeteer allow only specific Image to load

How do I block all images from loading unless the image has x string in its source URL? page.setRequestInterception(true); page.on('request', (request) => { if (request.resourceType() === '...
user avatar
0 votes
0 answers
17 views

React: function in value, passed from context provider doesn't work

I'm trying to work with Django rest framework and now i want to send a POST message to log users in. im using context to have the login function in the whole app // index.js ... root.render( <...
user avatar
  • 53
0 votes
0 answers
10 views

Uploading files to an ftp server using express

I have to keep this as generic as possible for various reasons, and please direct me if this question has already been answered before. Essentially I have a NodeJS client created using express running ...
user avatar
  • 1
0 votes
0 answers
10 views

Minify/uglify html page with embedded script tags in a nodejs app

I have an express app that, among other things, delivers some html code based on a single handlebars template. It would be great for the use-case to deliver it with short latency. So I read and ...
user avatar
  • 3,460
0 votes
0 answers
20 views

How to use object generated in index1.js in index2.js file

How to use object generated in index1.js in index2.js file Hey guys, so im making a quiz, i want the final result of the quiz generated in index1.js to be passed to another file index2.js where i will ...
user avatar
0 votes
1 answer
27 views

Passing variable to href

How can I get const targetCV to the href? This function, on click, is supposed to get targetCV and fetch the file if lang = pt or lang = en import { useTranslation } from "react-i18next"; ...
user avatar
-2 votes
1 answer
33 views

Replace a string if it's not a comment or inside quotes

I'm making a Javascript superset ( just as a hobby ), and i need to replace my superset's keywords with javascript ones, but when i use something like: .replace(/set/g, "var") it replaces ...
user avatar
0 votes
0 answers
8 views

Accessing functions in external folders to public_html in node.js/express.js

I cannot access JavaScript code outside the public_html folder defined by express.js in Node.js. I was able to do so when I used PHP and Apache instead of Node.js and NGINX. I could call a PHP ...
user avatar
-6 votes
0 answers
21 views

Calculate the sum of prompts [closed]

I am building a simple golf game. I prompted the user for their name. I would like to prompt the user with a number of questions in a loop. The questions will ask how many putts they had for each hole ...
user avatar
-1 votes
1 answer
27 views

Javascript and HTML defer tag not working

The Javascript function below works perfectly when at the bottom of html file. However, I need it in main.js file. It has been suggested that adding the defer tag to the script tag will enable this ...
user avatar
-3 votes
0 answers
22 views

How to convert lottie animation (json file) to mp4 fast (python\ JS)

I use puppeteer lottie (cli) to convert lottie files (JSONs) to mp4. It works nicely, but the runtime is super slow, sometimes more than a minute for 5 seconds video. I didnt find a better way to do ...
user avatar
-1 votes
0 answers
10 views

How to know what class inheritance is object from database

I have a base class that is used as a blueprint for other classes. Data of these classes are stored in SQL database and loaded when needed. The problem is how I can know what database object ...
user avatar
  • 1

15 30 50 per page
1
2 3 4 5
160973