Questions tagged [javascript]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs] etc.
2,249,647
questions
0
votes
0answers
11 views
Javascript: recursively Fetch data to populate html text
Disclaimer: This is my first question, and I am new to JavaScript.
I am attempting to populate some html text elements by fetching data using an API. This API returns a JSON object with some of the ...
-1
votes
0answers
6 views
running sum using Javascript for Qualtrics survey
I am working on a survey which on one page a participant makes 3 shopping decisions (3 multiple choice questions). They have a budget of, say, $100, and we want them to spend no more than $100 but ...
0
votes
0answers
4 views
three.js Highlighting the edge of a cube on hover LineSegmentsGeometry
I am using LineSegmentsGeometry and LineMaterial to create thick cube edges. I want to change the color of the edge on hover.
const edgesGeometry = new LineSegmentsGeometry().fromEdgesGeometry(
new ...
0
votes
0answers
6 views
Exporting and Importing javascript objects
I think I am asking a simple question but I only started learning javascript in recent days. I was trying to import the exported object present in another file, but not able to access its keys.
In the ...
0
votes
0answers
5 views
Trying to find a way to make new columns with JS
I am building a table with JavaScript. If you check the link you can see it is all in one column, but I need the name. prices, and images in separate columns. I am honestly not sure where to start to ...
0
votes
0answers
7 views
Use Intl.NumberFormat to format square foot units
I'm trying to use Intl.NumberFormat to format numbers with units and I have some units of square feet.
When I try
new Intl.NumberFormat('en-US', { useGrouping: true, style: "unit", unit: &...
0
votes
1answer
15 views
Discord.js: How can i make my bot typing for some seconds?
I wanted to put a small "cooldown" inside my Discord bot before the bot responds to a command, do you know what I have to add to make that happen?
0
votes
0answers
5 views
Native-Base Installation
When I try to install native-base I get this error:
(node:6636) ExperimentalWarning: The fs.promises API is experimental
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ...
0
votes
1answer
24 views
Javascript add class to element using js
i have created a list with js(works fine) whenever the user is focusing the password field:
let password = document.querySelectorAll(".control-group")[3];
password.addEventListener("...
0
votes
0answers
7 views
Sweet Alert 2 Icon Does Not Render Properly
I'm trying to create a modal that pops up when the webpage loads. The modal opens as expected but the icon and the animation do not render properly. My code snippets are from the website SweetAlert2.
&...
0
votes
0answers
7 views
Communicate messages between clickButton handler and a command file in Discord.JS
I'm creating a Discord.JS game bot and I'm trying to make a command (rob) and use Discord.JS buttons with the discord-buttons library.
I made a clickButton handler, but I'm not sure how to tell the ...
0
votes
0answers
7 views
Heroku H12 ERROR, 503 Status, app works completely fine locally but crashes on heroku
so I have a nodeJs server successfully set up, an everything works fine except for this one thing, this is the full route:
app.get("/search=:id", (req, res) => {
var id = req.params....
-1
votes
1answer
11 views
how to run main.js, cros.js and server.py at the same time on a server
I am a newbie. I don't have any idea about this. need your help. please help me!
I have 3 files main.js, cros.js, and server.py and I want to run these files simultaneously on my digital ocean server. ...
0
votes
1answer
26 views
How to bold day for multiple hour tables?
I currently have this code which highlights the day for an hours table that I have. It does this job properly for the one table, but not for the others. I have 4 tables in total on this page and need ...
0
votes
0answers
6 views
How can I fix this layer from appearing multiple time when using MERN and CRUD operations
I am creating a data table using MERN CRUD however when the user hits delete I want a Layer(Modal) to appear and then have the option to click yes or no. The problem that I am having is that the ...
0
votes
0answers
5 views
Yup Validation - how many times did validation run
How would I get the number of times a validator ran?
import * as yup from 'yup';
let schema = yup.object().shape({
name: yup.string().required(),
age: yup.number().required().positive().integer(),...
0
votes
2answers
31 views
Data from json gets undefined
Im getting data in my .json file
{
"types": [
{
"type": "Lotofácil",
},
]
}
in the console.log(data) i get all the data in the .json
but data.types.type ...
0
votes
0answers
10 views
How to copy additional files e.g. config/config.yaml, to .next folder
I have following folder structure for NextJS project:
_posts/
components/
hooks/
config/ <--- includes config.yaml file for server
pages/
public/
.env.local
...
yarn build copies all dependencies ...
0
votes
1answer
21 views
How do I make an html text input readonly but be able to update with a script?
I have these inputs that take the values of a from a in my table when I click on a row. I want to make it so that the user cannot change the input themselves but want to bring values into them when ...
0
votes
0answers
10 views
Delete request using box modal in MVC
I have a box modal that I created in my view using HTML that is called when the user presses a button called delete if they wanted to delete a request. From here the user sees two buttons, one to ...
0
votes
1answer
5 views
PDF.JS overlay can not be made draggable
I successfully used Add HTML overlay to PDF.js viewer however when I tried to make the element draggable following the instructions in How To Create a Draggable HTML Element it did not work.
Dragging ...
0
votes
3answers
33 views
Not able to display image using javascript
I am using VSCODE to make a blackjack game using HTML, CSS and javascript. I have defined a button that on clicking gives an image(that is stored in computer). Every time I refresh the live server(...
1
vote
2answers
18 views
In javascript how I run a function on multiple divs with the same class to get different results
I'm trying to run the same function on different divs with the same class. The thing is that I need the function to use offsetTop of each container and every div has a different value. The divs have ...
0
votes
0answers
8 views
Simple website footer through Chakra React
How would a make a footer on a website using Chakra UI and React? I know that there's https://pro.chakra-ui.com/components/marketing/footers code to do this, but I'm not sure how to make the 'App' ...
0
votes
0answers
11 views
How do I fix the calculator error in my code?
Help me, please. My javascript code is not working. I am trying to write a differentiated payment calculator. But my code doesn't work. It looks like the error is somewhere in the loop. I can not ...
0
votes
0answers
5 views
Prevent bootstrap select's dropdown from closing when clicking the dropdown div without event.stopPropagation()
We have a custom bootstrap select where we have 3 extra buttons alongside the options, when you click any of the buttons, including the action buttons (Select all, Select None, Done/Close) you can ...
0
votes
1answer
18 views
How can i a confirm dialog with input on sweetalert2?
function order(id){
const { value: numberinput } = await Swal.fire({
title: 'You are ordering' + id + 'are you sure?' ,
text: 'When you press the "Order!" button, your ...
-1
votes
0answers
31 views
why this javascripts elements not working? [closed]
i'm new at programming and i started with html and css. Now i'm using bootstrap and i can't use some javascript elements in my page (like tooltips or popovers). i have in the head tag bootstrap.min....
0
votes
0answers
15 views
My Request Form PHP program is not able to save request to DB and not able to send email
I'm in the progress of making a service program form for my small group but there are two problems that are causing it not to work. I'm able to open my PHP form on server but when I fill in details ...
1
vote
1answer
17 views
How to select multiple selected choice in dropdown using Javascript with specific delimiter
i'm trying to get the value of dropdown of multiple selection in the dropdown .
// dropdown display
<!-- begin snippet: js hide: false console: true babel: false -->
<select id="...
0
votes
1answer
14 views
do not show the component if the key has certain element
i have a dictionary where it has keys and data associated with the key as shown below.Dont show the span for key in which Total value is present. i mean if the value is present in values associated to ...
0
votes
0answers
10 views
How do I select an element that only contain spaces with jQuery? [duplicate]
I have this site that I'm trying to fix up. A plugin, or something, has placed various <h1>, <h2>, <h3>, <h4>, <h5>, and <h6> tags everywhere with no content in ...
0
votes
0answers
17 views
TypeError: myVariable.displayName isn't a function [closed]
I'm making a command where a random kill message is used when the command +kill is used. Here's my code -
if(message.content.startsWith("+kill")) {
const user = message.mentions....
0
votes
1answer
27 views
How to check if data is already in array in javascript?
I am working on a JavaScript project using Bing-Maps API. The goal of the project is to search for businesses in user's area, and then print their names and phone numbers on the screen. Bing has a ...
0
votes
1answer
22 views
Javascript test for null array not working
I'm using a tool that has Javascript ES5. I'm trying to test if an array is null or not via an if condition. The output of the array before the if states its "null" (see test result below);...
0
votes
1answer
19 views
How can I get my jQuery function to run inside of another function
I need help understanding why my jquery inside of forty is not working. I am working to create a virtual microscope and when the user clicks an image of 40x, I want a video to be displayed and be able ...
-2
votes
0answers
9 views
How Can I develop my web-apps using the “NO-framework” philosophy
I have been using Angular to develop some web apps and I want to try going "no-framework" doing everything from 0, and if need i will use libraries when needed. Any advice?
-1
votes
0answers
8 views
Use Firebase App Check with the debug provider in react
I have an react application and firebase appcheck enabled, I want to keep developing it on localhost.
I tried to follow the documentation Firebase provide but I can't figure out how to set a window ...
0
votes
0answers
13 views
Inserting select all checkboxes into JS proving difficult
I have recently started helping with a live project to do with calculating values of "dimensions" containing different "enemies", "evolutions", and the rewards thereof. ...
0
votes
1answer
19 views
How to write basic Error Handling when using AJAX JSON
I'm not as clued up when it comes to back end development but have this small task of adding some error handling to the code that you see below. All I'm looking to do is display the potential error ...
0
votes
1answer
17 views
Destructuring Objects and default parameters
I have a problem to solve involving default parameters and object destructuring.
I have an object 'product' with this shape:
{
name: "Slip Dress",
priceInCents: 8800,
...
0
votes
1answer
16 views
Infinite render caused by child component taking props from parent
I have a component which fetches data and then passes props to a child child component.
This causes and infinite re-render caused by child component. I wonder what is happening
Here is how my code ...
0
votes
0answers
12 views
`Model.updateOne()` buffering timed out after 10000ms But part of it works
I looked at all similar stackoverflow posts, but I couldn't resolve them.
And it's not that it doesn't work at all, it's that some parts of it work and then an error occurs.
./modules/mongodb.js
...
0
votes
0answers
9 views
TFJS: Cannot read property 'apply' of undefined
I'm trying to implement a custom layer in TensorflowJS as follows:
const tf = window.tf;
class InstanceNormalization extends tf.layers.Layer {
constructor(config) {
super(config);
}
...
0
votes
0answers
14 views
How to achieve this main content next to the image?
I am working on a school project I want to do a responsive text which is similar to the picture below and further when it switch to mobile view the text have to change its position and fit below the ...
-1
votes
0answers
14 views
“TypeError: Cannot read property 'filter' of undefined” and similarly for other array functions like map using ReactJS and redux
I am following a tutorial and when at this point I'm getting stuck. It gives me TypeError: Cannot read property 'filter' of undefined when I try to filter through the Product array. I was ...
0
votes
2answers
30 views
script won't link to index.js
It's my first time learning JavaScript and I've already stumbled upon a thing that I can't understand. I'm following freeCodeCamp's tutorial JavaScript Programming - Full Course and at min 10:00 I got ...
-2
votes
0answers
16 views
My gravity simulator doesn't seem quite right. Help please! (Processing JS)
Here's the link to see my program in action:
https://www.khanacademy.org/computer-programming/bouncing-ball-interactive-new-gui/4666696546598912
In order to start the program: Press "THROW" ...
-1
votes
0answers
5 views
When i shrink my screen size the menu items go off the page. I want my menu items to scroll in while the page shrinks
I want my menu items and navbar to behave similarly to the robinhood.com navbar. If you shrink the page from the right to the left the menu items move in until they reach the smallest media screen ...
-4
votes
0answers
18 views
CSS and JS. Display in testris style
Help solve the problem: Need to place a div's with Tetris style text at the bottom of the block. As if they accidentally fell from above. And when you hover over the menu, div's pulled up to this menu ...