Questions tagged [javascript]

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

0
votes
1answer
12 views

making post request issue

I'm trying to print the data received from the body yet not working. Here is my attempt ... router.post('/api/main',(req,res) => { if(req.error){ res.status(400).send(error.details[0]....
0
votes
1answer
7 views

html5 <audio> set border color with javascript when playing

digital store with mp3 files: html5 'audio' tag is used, with 'controls'; works superb since there are many audios, user should be visually reminded which one is playing - i want border around audio ...
0
votes
0answers
5 views

Material-UI SimpleTable event handling

I am looking to obtain the rowData from an event triggered on the material-UI table component. The application I am building is very basic and thus needs just a basic table. I have tried passing ...
0
votes
0answers
5 views

sorting through an array to place code in the proper divs through jquery

currently making a website to index and play movies stored on my hard drive that I've recently pulled off dvds just as a little side project. I have a 'master movie list' json file with all the data I ...
0
votes
0answers
5 views

Bootstrap tabs don't function properly inside a modal

I am using Django and Bootstrap to display nav-tabs inside a modal, shown when a button is clicked. The issue is that when a tab is clicked its content is not shown. Below you can see a simple ...
1
vote
0answers
8 views

PHP SQL form with JS action - show result only in individual div instead of all

I need to echo the result of a dynamically created form post request only in one div. The original table and scripts are more complex, but I broke it down to the basics for this example. Table: ...
0
votes
0answers
7 views

type refining in flow union, flow doesn't recognize if-statement

Well considering the following simple code: /* @flow */ type A = {| value: {id: number} | number, value2: string, |} type B = { ...$Exact<A>, value: number, } function foo(b:B, add: ...
2
votes
1answer
16 views

How to prevent a user from being redirected to a link in JavaScript?

var $ = function (id) { "use strict"; return document.getElementById(id); }; $(document).ready(function () { "use strict"; $('redirect').click(function () { window....
2
votes
4answers
28 views

what is the equivalent of this code in javascript

I am trying to read some code which is written in ruby. I am conversant with JavaScript and would like to understand what the code translates to in javascript. Here is the code: def two_d_translate(...
0
votes
0answers
12 views

How to send notifications from actions on google on a particular date and time

I am making an action on google where I need to send a notification to the user on a particular date.I have searched the web but I couldn't find the solution.Can someone please tell me how to ...
0
votes
2answers
15 views

Receiving Post data (not form) in Express

I am getting a string through a prompt and I want to send it from the client to my server (Which uses Express). Client: username = prompt('Enter your Username'); req.open('POST', url + 'username');...
0
votes
0answers
9 views

jumps while deleting multiple animate tags on one svg element. With JS

I'm manipulating svg using vanilla JS. I want to change it's position and shape when user moves mouse. I've tried to change d attribute but it's too big, there is a lot of calculations, jumps so now ...
0
votes
1answer
10 views

Vue cli 3 project alias src to @ or ~/ not working

I have installed the project with vue cli 3 but as the project grows, the import on the components are getting ugly, i end up importing a component like import Component from '../../../../...
0
votes
0answers
7 views

In Discord.js, How do i make an argument expected as a user ID?

my question is about these lines for a Bot on Discord: client.users.get("idhere") .send("message") How do i turn it into a script where it takes an argument and expect it to be a user ID? (Can you ...
0
votes
0answers
13 views

Why am I getting an infinite loop error inp5.js?

I am a beginner and am doing experiments with color in p5.js (a javascript library). I finished my project and decided to add semicolons as I usually forget them. When I added the last one, an error ...
0
votes
0answers
16 views

Creating a full screen popup window and updating the scroll bar

I want to create a full screen window using CSS, I have seen this question. My problem is that my full screen window is quite long, and I get a scroll bar inside the main page... would be possible ...
0
votes
1answer
11 views

How do you get selenium webdriver to return all HTML from website?

I am trying to scrape real estate listings from https://www.utahrealestate.com/search/map.search/page/1 and am having trouble getting selenium's webdriver to scrape all of the html. From what I can ...
0
votes
1answer
18 views

Resolve Promise or add Callback after Array push() method

I am using map() over a long array and using fetch for each value. It will take many seconds to complete. I would like to know when the final push is complete and use the data in the array. I tried ...
0
votes
1answer
10 views

Data Studio connector: Running a promise?

I am trying to setup a custom data studio connector. In the "getData" call I need to run two api calls before I return the data. I have been told that using a javascript promise is the best way to ...
0
votes
1answer
24 views

Images from home page on website disappear on mobile

The website is www.jobconscious.com and the pictures on the home page disappear when the browser is resized to mobile size/view and when on mobile.
0
votes
0answers
7 views

D3.js: Transitioning the gradient fill of a single node among many

Let's say I have an SVG with a structure similar to this: <svg> <defs> <linearGradient id="gradient-red">...</linearGradient> <linearGradient id="...
0
votes
0answers
12 views

How do I create squares with a function, and move a picture with a Id?

This is my code, I need to make a maze game where I can move the figure around and can't go through he walls and get to the end of the maze. var mazeData=[ [1,1,1,1,1,1,1,1], [0,0,1,1,0,0,0,1]...
0
votes
1answer
14 views

Settingobject property to a value parameter in brackets vs without brackets

In the following function, what is the difference between putting the brackets around value in collection[id][prop] = [value] vs not using brackets? function updateRecords(id, prop, value) { if (...
0
votes
2answers
28 views

Get values from html form to JavaScript objects

I am having problems with passing values from HTML to JavaScript. This is a little RPG game I'm building and I want the user to type its name, age, class, and race in a form and create a Character ...
0
votes
0answers
21 views

How to conditionally load javascript files based on tab toggled?

I want, depending on the radio selected, for the javascript associated with the radio to function, and when its not selected or deselected, to not be functioning. HTML for tabs and radios: ...
0
votes
1answer
15 views

Any component doesn't render after importing react-bootstrap library

After npm init and installation of react, react-dom, bootstrap and react-bootstrap packages, I can't import any component from react-bootstrap library, as import Button from 'react-bootstrap/Button'; ...
0
votes
0answers
11 views

laravel mix not able to find style.css or images on front end - where am I going wrong?

I am using laravel mix to bundle my assets and I can't seem to get my bundled styles.css or images working in the front end, I get the console errors below: Codebase: https://github.com/bennkingy/...
0
votes
1answer
23 views

the correct way using middleware in express

hey I want to make sure if I use the correct way for middleware in my simple express app, I am trying to find the email unique for register here is my example const isUnique = (req, res, next) =&...
0
votes
0answers
12 views

front-end tokenizer for user inputs with insert/order awareness

I'm trying to find a react library or something similar to react-select, but with the ability to insert more tags/tokens between inputs. For example, in this photo, if I were to press the left arrow ...
0
votes
1answer
21 views

Possible to change the default directory in node.js?

I started working on an existing project that has a directory structure like below: /node_modules /web /js/index.js /styles/index.css /index.html /package.json /webpack.config.js I'm ...
0
votes
0answers
8 views

HowlerJS and Web Audio distortion across browsers, in GainNode? AudioBufferSourceNode?

I'm trying to understand how a Web Audio GainNode or AudioBufferSourceNode could introduce persistent audio distortion, as if an audio file or loaded data buffer is corrupt Working on an HTML5 game, ...
0
votes
2answers
29 views

im getting unhandled issue

im getting the following error issue throw er; // Unhandled 'error' event Here is my Controler.js const router = require('express').Router(); router.post('/api/sendMail', async (req,res) => { ...
0
votes
0answers
10 views

Capture keydown events for multiple child iFrames in parent document?

This question says the only way for an iFrame to capture keyboard events is when it has focus, but the goal is a little different. Our page embeds multiple iFrames, all of whom monitor the same ...
0
votes
0answers
6 views

How to run a client side script when PayPal API V2 onApproval is completed

This is my current paypal script <script language="javascript" type="text/javascript"> function populatePayPalButtons() { paypal.Buttons({ createOrder: function(data, actions) { ...
0
votes
0answers
17 views

How to beautify javascript code and highlight correspondence of the original code at char number?

Is there anyone show me an (online) tool to beautify javascript code and highlight (or show line numbers of) lines of code of the beautified code which are correspondence of the the minified code at ...
2
votes
3answers
38 views

This code isn't working & is their a more efficient way to do this rather than using a else if statement?

I'm new to all this, i have a project for college, can't seem to get this to work and it seems to have a lot of repeating code, any help would be great, thanks. var strength = document.getElementById(...
0
votes
0answers
12 views

Google Apps Script to open pdf on google drive then open in web app

I am using google apps script and I want to open a pdf file from a google drive then show that file in a web app via html. I created a stand alone script and i can open the pdf by id. //function ...
0
votes
0answers
17 views

Combine a Button and a Input using JS to 1 Click

Once i again ill have to ask a question. I have a (designed as a Button) and an actual . One is sending an SQL Query and one is running a Function on DropZone to upload a picture to my server. I ...
0
votes
0answers
15 views

Runtime and spacetime of built in JS functions

I am trying to figure out the run / spacetime complexities for some built in javascript functions: ie something like A.concat(A.splice(0,p)). Does anyone know of a resource where I can find documents ...
-1
votes
1answer
26 views

How to generate set strings in javascript

Trying to generate a set of strings such as 'TCP', 'DNS' or 'SQL' I want to be able to have these strings set and be able to have them appear randomly like you would with random numbers.
-1
votes
4answers
35 views

How to display and shut message modal when hovering over buttons

I would like to display a text description box when I hover over the button and close it when not hovered. At the moment, when my button is hovered the text box displays, however I need to click off ...
0
votes
1answer
17 views

Execute javascript file in child process within Electron

I've got an Electron app with Angular inside (last versions). I need to execute javascript (not typescript) file from the project in child process (some heavy things that I don't want to execute ...
0
votes
1answer
18 views

A way of hiding a div for a set of IP addresses - using javascript

There are ways of recognising IP addresses from certain countries so I can use $("#myDiv").hide(); to not show a div when these countries occur. However, I want to recognise IP addresses from a ...
1
vote
3answers
27 views

Create a Input and Label for each object in an array

I have populated an array with a list of ingredients. I need to make a dynamically create a checkbox & label combo for each object (just the "Name" Object) within the array here is the code that ...
3
votes
2answers
45 views

Convert ES6 Arrow Function to ES5

I found a function I can use in a Leaflet project I’m working. The function is written is ES6 and it works great in both Firefox and Chrome. However, I need to target IE as well. In my research I ...
1
vote
0answers
12 views

How does TurboLinks display response HTML?

I am studying the basic internal functionality of the JavaScript TurboLinks framework at the moment. From what I understand, onclick events are assigned to all anchor tags to be able to prevent the ...
1
vote
0answers
10 views

How to get bullets to work properly in glidejs

I'm trying to use glidejs as the slider on a website, however I can't get the bullets to work properly. The bullets are at the bottom of the example on glidejs' website on this page: https://glidejs....
1
vote
0answers
34 views

JavaScript Proxy - Add other properties intermediately

Here is my proxy: const handler = { get: function(target, key) { const next = target.object[key]; if (typeof next ==='object' && next !== null) { return new ...
-1
votes
1answer
13 views

datepicker not working when i add plugin jquery and jquery-ui

I have add datepicker for jquery UI but I have this error: Uncaught TypeError: $(...).datepicker is not a function I add plugin jquery and jquery-ui but I have also error code twig: <!...
-5
votes
0answers
28 views

Require assistance with coding a word guess game in javascript

I'm creating a word guess game which looks like this. I have created the bootstrap divs that will hold the info of my code and declared some variables, but I am now stuck. Disclaimer: I am quite new ...

http://mssss.yulina-kosm.ru