Category "javascript"

ReferenceError: "_" is not defined

recipe = new Recipe(_.pick(req.body, ['name', 'tag', 'recipe'])); await recipe.save(); }); error: recipe = new Recipe(_.pick(req.body, ['name', 'tag

how to use a 'change' event on a 'number' input to change the quantity of a product in a cart page in local storage and also in the DOM with Js?

Please can you help me? I am doing an exercise on the creation of a dynamic e-commerce site (API and JavaScript) and I am stuck on my shopping cart page which m

How can you read POST data from a javascript XMLHttpRequest in Golang?

Here's the javascript function called: function cwk_submit_form() { var form = document.getElementById("FORM_ID") var XHR = new XMLHttpRequest(); con

How to inverse modify value of a prop

I've got a doubt regarding if there's a way in Vue to do the same as a prop but in the inverse way. Let me explain a bit better, so for example, I've the follow

Dropdown menu code not quite right on mobile

I have built a menu on this page that is live: https://boys-cry.com/ and it was working fine until I added the mobile background content on a different section

How can I force safari to enable my website javascript?

Recently I've got feedbacks from collegues and friends that some features of a website of mine doesn't work on Apple devices. With some research, I found out th

How can I simplify a nested object which has a lot of repetitions?

All these three objects have the exact same property and values. Is there any way to simplify the code and make it shorter? const MyMap = { 'myObject': {

How to post data to API in jQuery DataTable ajax?

Hi all I am using jQuery DataTable and performing server-side pagination and sorting. I am stuck at one place, I am having API that is of type POST, so I need t

What is the scope of variables in JavaScript?

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the v

Discord js 13 button edit permission channel

When a person sends my command, a channel is created that only they have access to. Also, when creating a channel, a message is sent with the "accept" button, w

Decrypt AES 256 CBC using crypto-js

i have the following key to decrypt erUF9SRCNQZPCBezVGzYYnUVgwAKZTvXzS5Zhgw6B/4= into "54545fwfwefweffvfdv", I tried searching for similar question but the lack

The SDK has not been intialized. Got this error while running react native android application in debug mode

I am using react-native-fbsdk-next(version 4.6.0) in my react native project. I followed the docs accordingly but then it started giving me following error sinc

How to use a capacitor plugin meant to be imported in a vanilla js app

I'm currently pulling hairs trying to figure out how to go about this. So, I'm working in a vanilla JS environment with no webpack setup served with capacitor a

if i using angularjs function excel upload button function how to write my code

I writed code $scope.updatepricingimport = function(file) { debugger if(file == null || file == undefined || file == "") {

How to add an active class to an active Link in react router dom v6.3 using styled components - ReactJs ^18.1.0

I have designed my NavLinks using the styled-components. I want to add an active class to the active link I am unable to do it. I tried the isActive property bu

Change drag image inside a DragEnter event

I'm trying to define the image that appears when I drag an element inside my page. I saw how to do it with DataTransfer.setDragImage() in that link but with me

Webpack + JS: Multiple outputs with one file

It it possible to make several outputs with one JS file, but different versions: The main JS file should include different settings or extras: Version 1: import

javascript regex to match a combination of and/or expression

I want to match a combination of and/or expression and match only sentences in between for example test1 test2 and test2 or test4 test5 I want to get matches t

How to execute dart generated javascript from dart

I have this dart script that I compiled to javascript. How do I go about calling this javascript from dart? I'm trying to eventually call this from a web worker

Take input from user and verify if it is present in an array. (Javascript)

How can I take input from the user and check if the number is present in my array or not. I need to generate random number from array1 and move it to array2. Th