Questions tagged [javascript]

JavaScript (not to be confused with Java) is a high-level, dynamic, multi-paradigm, object-oriented, prototype-based, weakly-typed, and interpreted language used for both client-side and server-side scripting. Its primary use is in the rendering and manipulation of web pages. Use this tag for questions regarding ECMAScript and its various dialects/implementations (excluding ActionScript and Google-Apps-Script).

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

What is the difference between `buffer.toString('utf8')` and `buffer.toString('binary')`

const atob = (encodedString) => Buffer.from(encodedString, 'base64').toString('binary') What is the difference between buffer.toString('utf8') and buffer.toString('binary')? Is there any API on ...
0
votes
1answer
14 views

What does the construct “const increment = ()();” do in JavaScript?

I am dealing with this example of Javascript code: const real_numbers_array = [4, 5.6, -9.8, 3.14, 42, 6, 8.34, -2]; //Karkoli že je increment, sedaj postane funkcija. const ...
0
votes
0answers
11 views

Laravel join multiple tables to get data

In my scenario i have 3 tables. customers, services and services_info. customers table: id | firstname | lastname ..etc. services table: id | service_id services_info: id | category | service |...
0
votes
0answers
12 views

how to create last 1 hour's minutes and last 24 hours arrays using moment.js?

I've a usecase where I need to create 2 arrays, one is last 1 hour's minutes with 5 minutes interval and last 24 hour's every hour with 1 hour interval. I've written the code and it's working fine. ...
0
votes
0answers
7 views

How do I pass a list of models from a table in a view to a controller?

I'm just learning about MVC and a problem I've run into is passing a list of models to a controller. I have AutomationSettingsModel, which contains a list of AutomationMachines. I've successfully ...
0
votes
0answers
4 views

How do I stop ffmpeg from spamming itself when I auto restart?

const fs = require("fs"); const express = require("express"); const app = express(); const path = require("path"); const ffmpeg = require("fluent-ffmpeg"); const md5 = require("md5"); const readline = ...
-2
votes
0answers
13 views

Guys, i create frame bank and visa.. But how can validate it

The bank frame just input number bill (usual 10 numbers) and visa number there are 16 numbers with month to 12, years and cvv.. My friend told me "if month(visa) more than 12, can it paying your ...
0
votes
0answers
12 views

Javascript is a single threaded language .Then how can we use async ,callback functions?

I have posted this questions to know how Js behave as aynchronous language?
0
votes
0answers
17 views

keep javascript dropdown selections from $(window).on('load', function()

i am using a slightly modified version of a script from here,Select start time between start and end time the script $(window).on('load', function() { $("select[name='SelectedTime1']").on("change", ...
0
votes
1answer
16 views

REACT i'm malding because of “Cannot read property 'map' of undefined”

import React from 'react'; import './BusinessList.css'; import Business from '../Business/Business'; class BusinessList extends React.Component { render() { return ( <div className="...
0
votes
1answer
20 views

points.dist = function () { ^ ReferenceError: points is not defined

This function was copied from "JavaScript: The Definitive Guide" but for some reason it doesn't work... **points.dist = function () { ^ ReferenceError: points is not defined** Im new at this, ...
-2
votes
1answer
19 views

How to get this onload screen effect

How to get this initial onload effect in my web page. Am using bootstrap4 and javascript. Am new to javascript Template Link
0
votes
0answers
17 views

Print different array into different column of excel

i want output like this but i am getting output like this const XlsxPopulate = require("xlsx-populate"); var data = { XYZ: [ { email: "[email protected]", office: "xyz.in", ...
0
votes
0answers
16 views

How querylist object is used by angular?

I am learning angular and came acreoss viewchildren and contentchildren.These are querlist objects in angular.During lifecycle hook ,angular updates querlist. and qurylist object stores view nodes....
0
votes
1answer
15 views

I have problems with DOM in javascript

Text editor: Visual studio code Browser: Firefox OS: Fedora 31 and with node, I get "document is not defined" I'm new so I don't know what to do? My error: TypeError: lovers.style is undefined ...
1
vote
1answer
34 views

delete image preview before upload

I am uploading multiple images and showing preview, it is working fine. When I want to delete a particular preview image the preview image is deleted but when I upload all the files are uploading. ...
-4
votes
0answers
15 views

Why does innerHTML not react to a .innerHTML JS function? [closed]

I'm attempting to make navigational tabs using buttons and JS functions, and the tab part seems to be working great. However, the content that's supposed to change when you click the tab won't change. ...
0
votes
1answer
28 views

How to use ngModel in the radio group from the api in angular

here's the code. list.component.html <form nz-form [formGroup]="taskFormGroup" (submit)="saveFormData()"> <div nz-row *ngFor="let remark of checklist"> <div nz-col ...
0
votes
0answers
11 views

How do I add css class names to text blocks in Squarespace?

I need to add a class name or an ID to a Squarespace textblock to be targeted by JavaScript. If I use a code block to add the text, I can add a class name, however it can't be edited easily like other ...
0
votes
1answer
13 views

await page.waitFor inside page.evaluate in puppeteer?

I was wondering if you could do something like page.evaluate((page) => { //Code to execute before await page.waitFor(1000); //Code to execute after the 1000ms time delay }, page); ...
0
votes
1answer
24 views

React : How to make password characters visible when typing each character and hide(*) after few time interval in react?

I want my password field behavior as shown in this image I found few solutions using jQuery and tried to convert it to react but It does not behave same with react as there is a setState which delays ...
0
votes
2answers
55 views

Only first element of the array is taken

i have searched of this issue on the internet but i dont find anything similar. i have an array in php. i passed this array to javascript function to check and disable checkboxes if their values are ...
0
votes
0answers
10 views

Unable to monitor blob requests or fetch blob URLs in Chrome extension

In my Chrome extensions, I need to monitor/fetch requests to blob: URLs. When I open the Chrome Developer Tools, specifically the Network section. I can see those requests a GET requests. However, ...
-1
votes
0answers
21 views

Buggy Variable JQuery [closed]

Below is some code that I have been working on. For some reason console.log(arrayOfSelection[i] + ': loaded fully!'); sometimes states undefined: loadedfully! rather than what is in the array. The ...
0
votes
0answers
10 views

How to get web midi to play midi controller connected to Logic?

So I have a midi controller connected to my machine, and I have it playing successfully with Logic Pro X on a mac. I'm trying with Web Midi API to send a note to this midi controller, as an output ...
0
votes
0answers
16 views

Intelsense not work properly , when i press ctrl + space in visual code it just show loading

enter image description here it happens when I run this uninstall -g create-react-app and install create-react-app with NPX, I tried uninstalling and install again but it's still same for me, is ...
0
votes
0answers
8 views

SVG image with gaussianBlur flickering around the edges in Firefox latest

codepen: https://codepen.io/cryptodescriptor/full/QWLrKMx github: https://cryptodescriptor.github.io/survey-form/ github repository: https://github.com/cryptodescriptor/survey-form Frosted Panel (...
0
votes
0answers
20 views

Why does `this.now = require(“performance-now”)` and `this.now()` not work well as a standalone JS file using Node.js?

I am attempting to write some code that works in most browsers and inside of the Node environment: if (!this.window) this.now = require("performance-now") function getNow() { return this.window ?...
-1
votes
0answers
30 views

JavaScript - big-O performance algorithm

Here is a simple algorithm exercise. My answer is correct. My doubt is about the big-O performance. Because in the problem statement it was writting this way: Write a solution that only iterates over ...
0
votes
1answer
19 views

How to automate a JS script to keeping repeating a instruction?

My goal is to make a script click continuously on this two button without need to call it manually, my script have the ability to click on the button, but I don't know how to automate the action, ...
0
votes
0answers
8 views

Dropzone delete not working on server side success

I have integrated dropzone library with laravel .Dropzone set following configuration autoProcessQueue: true, uploadMultiple: true, parallelUploads: 10, maxFiles: 10, paramName: "photos", ...
-1
votes
0answers
19 views

Combining Arrays Using forEach Method Causing Errors

I'm using the eBay Api to update values for items i have stored in a database, which is shown with favorites array below. On my Favorites page, i'm displaying a user's favorite items. I also have ...
0
votes
0answers
11 views

Click event not working with webcomponent

I am trying to add a click event with my web component element. but not works. jscode: class HelloWorld extends HTMLElement { shadowObject; constructor() { super(); this.shadowObject = ...
0
votes
2answers
24 views

Dynamically update a buttons onclick inside a Bootstrap Modal

I'm trying to pass a value into a Bootstrap Modal and then display it when a button is clicked, however nothing is displaying when I click the button.. Can anyone help fix the issue? I believe the ...
0
votes
0answers
15 views

How Can I Avoid “tainted by cross-origin data” on My OWN PERSONAL, locally stored, image files?

I am manipulating locally stored images using a locally stored HTML file via javascript and of course, jQuery. The image files, the HTML file with javascript, and JQuery.js are all stored on my ...
0
votes
0answers
9 views

Using external JSON file in JS: Access to XMLHttpRequest error

I'm trying to save my API key in an external JSON file and then import it into my Javascript file to use later. I have this in secrets.json: { "api_key":"123456789", "username":"my-username" }...
0
votes
1answer
15 views

Converting from JavaScript to JQuery

I'm trying to convert this code I wrote using JavaScript into JQuery. Anyone have any tips or resources to help me figure this out? JavaScript is so much easier for me to pick up compared to JQuery. ...
0
votes
2answers
28 views

Assigning value to function as object property within for loop

I am trying to create an array of objects. One object property is a function, which I want to change value of depending on which number in the array the object is. When I try to use the 'i' value ...
0
votes
0answers
5 views

CyberSource API implementation with 3d secure and Soap

I have already implemented a system with soap CyberSource which integrate a website to CyberSource. I have followed the rules from github(https://github.com/CyberSource/cybersource-sdk-php). However ...
0
votes
0answers
10 views

Jquery parallax effect on simple background image slider

I have created/modified a simple image background slider with a fading transition based on some code from someone else for learning purposes. Now I am trying to implement a parallax scrolling effect ...
0
votes
1answer
20 views

how to detect when a message gets edited

Hi so I'm trying to make a discord bot that deletes certain words I've managed to do this but I want to make it so it will delete edited messages This is what I've got so far client.on('...
0
votes
0answers
7 views

Fluent ffmpeg not running synchronously

I am writing a program where I need to process a video multiple times using ffmpeg. The ffmpeg codes (below) are inside a 'then' statement of a promise. ffmpeg(path) .size('640x?') .aspect('1:1')...
0
votes
0answers
26 views

when i createElement in one function, when i getElementById it results in an error

so this is my html code, now i know itd be easier just to code the elements into the html code, but i need to be able to create the element in one function, and modify it in another. so this is mt ...
0
votes
1answer
15 views

I am trying to query timestamps in firebstore

Here is my code. Right now, I am just trying to make sure I know how to format my date to get it. I have tried Month-date-year and that didn't seem to work. I was able to get the object that firestore ...
0
votes
0answers
18 views

How do you disable an app on chrome OS with javascript?

I am a bit more experienced with making games than interacting with files in ways this significant. I am trying to make a little GUI that can disable an app (on Chrome OS) and re-enable it. I have ...
-2
votes
0answers
15 views

how do i return the value from the .then() block to the parent function [duplicate]

getData(link, attribute) { const data = {}; fetch(link) .then(response => response.json()) .then(resData => { data[attribute] = resData[attribute]; return ...
0
votes
1answer
31 views

Update a react state (array of objects) from a child component

I would like to update the parent state from child component, which renders each object of the array of objects. The main goal of the child component is to update the original value from the array of ...
0
votes
0answers
6 views

phpseclib not verifying a signature generated in window.subtlecrypto

So yeah my boss wants to put encryption into his system and he wants messages signed in js and verified in php. currently, I'm using mozilla's subtlecrypto api to generate RSA-PSS keys and sign and ...
0
votes
0answers
13 views

JSS <ThemeProvider>, how to use media queries

I am trying to use to define some default colors that I want to use within my child components. The problem is that I also want to be able to set those colors according to media queries. For example: ...
0
votes
0answers
12 views

Sapper/Svelte.js - How to specify client-side assets location?

I have a Sapper.js application that I have successfully running on AWS Lambda. Lambda is able to deliver the server-side generated HTML created by Sapper to AWS API Gateway which then serves the app ...