Category "javascript"

Image cannot be an array or an object

I am developing a project which consists of publishing a post and being able to upload a user image. I used JS for Front and NodeJs for Back (Multer for uploadi

How to mention users using @ in django

I have been working on a project on django and it is very similar to instagram and twitter, one of the functions it needs to have is to mention users using "@"

How to get value from db.any() promise in pg-promise?

I use pg-promise and i tried to make a request to database in user model to get an array of all users like this: exports.getAllUsers = function () { let

keyIsPressed to write on canvas where mouse is clicked p5js

I am working on a function which enables users to write onto screen where mouse has been clicked however there are a few problems. Firstly: keyIsPressed is exec

the for loop exit after it has been executed one time

the for loop in the following code exit after removing one class and doesn't remove the other one unless I click the button again I want to remove the class hid

Metro Builder: SyntaxError: Unexpected token = after upgrading to React Native 0.65.1

Today I updated to React Native Version 0.65.1. After that I was unable to Start the Metro Server I am now receiving following error message while building a Re

Next.js API routes all return "Interval Server Error" in production, but all the routes work in development

Whenever I go to any API route in my Next.js app in production it returns a 500 "Internal Server Error" but in development, all of them work completely fine and

countDocuments() is not working in api call

I am trying to get a count of products using api calls but in postman its keep loading router.get(`/get/count`, async (req, res) => { const productCount =

Use access token from first fetch in a second fetch API in React JS

As a newbie to React I have been stuck for awhile on how to get my access token to be put to use in a second fetch API. In the first fetch (Get token), I am abl

How to convert Khan academy code to p5.js

I'm using the https://editor.p5js.org/Josef37/sketches/RGDv9lHkK for convert to p5.js and I'm still don't know how to convert 100% correct, the picture won't sh

How can i disable the Maximize button for BrowserWindow in Electron?

Im new to Electron.js and im trying to disable the Maximize button, i know its possible but i don't know how to do it. I tried frame: false but its not working

Best practice for importing component from components library in React.js

When I create components in React, they're all in a folder called component and each component has a dedicated folder with the same name as the component itself

MongoStore.create({ ..............Cannot read property 'create' of undefined

I have tried every possible step I've come across but the problem doesn't resolve. The error shows: C:\Users\...............\server.js:35 store: MongoStore.crea

how to pass variable between to vue file?

how to pass variable between to vue file ? Hello, this is my file SendCode.vue has variable NewEmail which I want to use it in another file changePass.vue . Is

Get the edited content in tinyMCE 6

I am integrating TinyMCE in my ember.js app. Unfortunately I cannot get back the edited content, or at least, all of it. tinymce.init({ selector: '#'+

What's the maximum precision (after the decimal point) of a float in Javascript

An algorithm I'm using needs to squeeze as many levels of precision as possible from a float number in Javascript. I don't mind whether the precision comes from

Reactjs recorder-js download

I am trying to make a React app for recording voice samples and save them as wav files, I used recorder-js to make the record but I am still struggling to make

Client-side jwt token storage

I need advice, what is the best way to store a JWT token? Should we store in cookies or storages? But with the CSRF flaw and xss attacks I have a doubt. I'm sti

why I can't get all folder's module with require('./folder')

i am using this: index.js functions └abc.js └reset.js functions.js functions.js const fs = require("fs") const functions_ = {} const files = fs.re

Running an if statement inside a querySelectorAll Node List

I am building a blog post layout which requires some metadata to sit on one side and stay in place as the content scrolls, using position: sticky. This works fi