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
9 views

Bootstrap 4 Dashboard Example Responsive

Today I was looking for a dashboard theme, and I found the dashboard example on bootstrap site (https://getbootstrap.com/docs/4.4/examples/dashboard/). I liked it so much, but there's 2 things that I ...
0
votes
0answers
4 views

How do I make hard surfaces in three.js?

I've seen games created in three.js that allow people to jump on boxes - how do I do this? Right now I have created geometry objects that allow other objects to pass through them but is there a way ...
0
votes
0answers
13 views

Object not updating inside mongodb find query (global/local variable issue)

I have been storing data in a mongodb using "username" as one field, and "data" as other field. The username just stores the username; however, the data field stores json data containing multiple ...
1
vote
1answer
22 views

arguments in function inside setInterval not changing

I'm implementing polling using setInterval but I'm running into some issues. I have a function to poll that looks like this const pollMessages = () => { if (interval) { return false; } ...
1
vote
0answers
8 views

Why does every single Doubleclick ad load the same amp4ads JavaScript files?

We have 3 or 4 Google / Doubleclick ads on our website per page. Every single one of the ads on a single page is loading 'amp4ads-v0.js' (54 KB) and 'amp-analytics-01.js' (40 KB). This is adding ...
-1
votes
0answers
9 views

Can not get power button to work with display to display time as innerHTML?

I'm currently building a digital clock wow super easy yes i know. I guess what i want to be able to do is to click the powerButton to turn on the clock and then display the time inside the ...
1
vote
1answer
15 views

React changing style of NavBar on scroll

I'm practicing some React here. I'd like my NavBar to get a backgroundColor past a certain scroll point which I've done, but when I scroll back to the top the backgroundColor does not change back to ...
0
votes
0answers
11 views

Trying to Dynamically change background video as user scrolls

I am trying to create a single page website with a video background that changes video URL or source as you scroll farther and farther down. I was messing around with window.onScroll but it doesn't ...
0
votes
0answers
26 views

js not reading my file to alert, undefined when printing to console

Why won't this read my file!? What am I missing NOTE - I also get warning : XMLHttpRequest on the main thread is deprecated because - not sure what else to use <script> function ...
0
votes
1answer
14 views

When I run the program I get image undefined and I have made many edits but I keep getting the same error

Whenever I run the HTA file I receive a script error with the error being 'acceptImage' is undefined. What am I doing wrong? A picture of the code
0
votes
0answers
9 views

React-Native image seems to load but it shows blank

I'm using an S3 bucket as origin for my app's images. Storage.get seems to be working fine, as when I copy and paste the link on the browser, it loads the image correctly. However, the Image tag seems ...
1
vote
0answers
12 views

React: Convert timestamps in list of objects from Node.js server and save to state

My question is regarding how to: Map through incoming fetch data array of objects Extract the timestamp property in each these objects, when these objects where created Convert these timestamps to ...
0
votes
0answers
7 views

how to create poll in slack api command?

I used slack api. I sended data to slack api url, for example 'https://hooks.slack.com/services/TXXXXX/BXXXX/XXXXXX' How to create poll?? I sended post method and params are text: '/poll "Which design ...
0
votes
0answers
8 views

Firefox extension can't add request headers?

I'm trying to port a browser extension from Chrome to Firefox using webRequest.onBeforeSendHeaders.addListener but any attempts to add request headers to requests don't work. If I modify the code to ...
0
votes
0answers
7 views

Express + React: CSRF Cookie is undefined in production, works locally

I'm hosting my express API on Heroku and my client on Netlify. When I try my signup route locally, my cookie is defined and the route works. However, when it is in production, the cookie always ...
1
vote
0answers
28 views

I want to use these codes and functions more efficiently

We are currently using vue.js to count. I started to write this article because I was wondering if there would be more efficient programming in the process of making it. When you click div, the ...
0
votes
2answers
18 views

how do i make a event listener for a button that is in a forwach loop

i have a for each loop where it loops through a table and the table has a id field which gets assigned to the button's id, i need to see which button gets clicked(i need to get the value of the id). ...
0
votes
2answers
15 views

How to render an array of strings using map in ReactJs?

I basically want to put each string in the array in a separated div, I'm trying to do this but is not rendering anything export default class Loja extends Component { state = { loja: {},...
0
votes
0answers
4 views

Don't know how to use navigation.navigate in React Native app

I created a basic SplashScreen.tsx that just has some text on it. Then, I created this LoginCreateAccountScreen.tsx, which has a Login button and Create Account button. I want my app to show the ...
0
votes
0answers
10 views

Express how to re-direct json data through different endpoints

I'm pretty new to using express and the responses here on StackOverflow have been very confusing. What I have is JSON data that I am retrieving using app.get(). What I want is to modify this data and ...
-1
votes
0answers
11 views

get number of selected row in a bootstrap table [closed]

i need to get the number of row when i click on the button and send this information in a modal fade i attached this image the head of the table is : <table class="table table-hover table-sm">...
0
votes
3answers
32 views

“value.toString(…).toUppercase is not a function”

in my vue component I have an "uppercase" filter to tranform strings into uppercase, however I'm gettinh the following error: TypeError: "value.toString(...).toUppercase is not a function" This is ...
0
votes
0answers
12 views

Custom cursor effect on Wordpress Theme

I am trying to add a custom cursor effect similar to below that is in Javascript to a Wordpress theme I am working on. I am new to creating my own theme and I am not sure where to apply the code. ...
0
votes
0answers
12 views

Promise.all and Firebase querySnapshot

The following code is not working in a cloud function. What could be the problem? I can't get promise.all to return a value. const ref = db.collection('riders'); const promesas = []; promesas.push(...
0
votes
1answer
21 views

change this style attribute from class element on click

const expandIt = document.querySelectorAll('.k-grid') .forEach(el => el.addEventListener('click', () => { el.classList.add('pressed') // This wont work getting HTML obj etc in console ...
0
votes
1answer
31 views

This function in Javascript using Firebase doesn't write in console, What am I doing bad?

I have this javascript function in "buscador.js" that should output a list of objects in the console but when i click on the button of the <form>, it doesn't work. function buscar(){ var ...
0
votes
1answer
15 views

Failed lookup for key in templates

I am trying to get Specific List in Dictionary, but first i got the error: "fail to lookup for key", searching on internet I found out a tread with this solution: {% with obj1.page.val2 as val2 %} ...
0
votes
1answer
14 views

addClass to jquery-asProgress.js when value is 100%

I'm using the library "jquery-asProgress.js" to produce 100% complete bar graphs. Library can be found here: https://github.com/thecreation/jquery-asProgress I'd like to have the bar change color ...
0
votes
0answers
18 views

“Javascript not available on browser” when Flask server receives an HTML Response from API

I spun up a local Flask server in order to create a Web UI for managing some of my network devices. When my networking device replies to my Flask server to ask for sign-in credentials, I receive this ...
0
votes
2answers
31 views

Function is not running after DOM ready Javascript

I have an issue with my Javascript code document.addEventListener("DOMContentLoaded", function(event) { thetitle(); document.getElementById("title").onkeyup = function(){ thetitle(); ...
0
votes
0answers
7 views

Toggle dynamic items from server generated list

I have created a dynamic list using escript and need to be able to toggle each section. At the moment, if I click the first element, all subsequent sections open or all sections close respectively. ...
0
votes
0answers
12 views

Inputting the static properties into the object variable

I want to make it so in the input box, when it is entered, the values are assigned to properties in the object variable, but the properties have to be static. For example: If for the weight you input ...
1
vote
3answers
28 views

activating checkbox on load with javascript or jQuery

hello I have a small project I'm working on. the project is calling an API with ajax and getting info about currencies, one of the things I'm stuck on is that I have to write them in cards that ...
0
votes
0answers
10 views

PDF with CSS using jsPDF in Aungular 8

I am using the jsPDF to create a pdf file and decorate it with CSS. However, I keep getting the error ERROR Error: You need either https://github.com/niklasvh/html2canvas or https://github.com/...
0
votes
1answer
22 views

How to move list items using keydown events

I want to move list items in an editable div in html using keydown events for the up and down keyboard arrows. The up arrow should move that list item up and the down arrow should be that list item ...
0
votes
2answers
31 views

Removing null at beginning and end of array

Looking for an algorithm that will remove null that occurs at the beginning and end of the array and nothing in between that is O(n) For example: [null, null, 1, 2, 3, null, null, null] -> [1, 2, ...
0
votes
1answer
21 views

Add Async Await to code Excel JavaScript API

How can I add async wait to the following code? I want to pass the following parameter “numOfParts” and then use the VLOOKUP Excel built-in function to find out what finalInspectionPerPart is from the ...
-1
votes
0answers
11 views

Incorporating Canvas-Sketch in a React app

Any recommendations on how I can incorporate canvas-sketch (https://github.com/mattdesl/canvas-sketch) into a react component?
0
votes
2answers
36 views

JavaScript finds HTML text that is not present

Simple question - Why does my log "find" test in my HTML page? It does not exist. Any ideas? Thanks all! <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-...
0
votes
0answers
10 views

Gulp bundling issue for Udemy Wordpress course

I've been coding along to Udemy's WordPress developer course and hit an issue with getting different parts of the folder to bundle when running gulp watch - I wanted to ignore it but it seems like the ...
0
votes
1answer
45 views

Unable to toggle between two CSS styles

I'm trying to implement a dropbox menu for a project I'm working on. I've tried to follow this method down below, but I am running into issues. https://www.w3schools.com/howto/tryit.asp?filename=...
0
votes
1answer
17 views

Electron call from renderer to main

As answered in How to call a function/module in Electron from my webpage? I tried it but code requires electron. const { remote } = require('electron'); const mainProcess = remote.require('./main.js'...
-2
votes
0answers
24 views

Selecting one object entry at a time es6

I have a top-level object, that has 3 object entries. Animal care: {Above expectation: 6, At expectation: 31, Below expectation: 18} Calving and calf rearing: {Above expectation: 8, At expectation: ...
0
votes
2answers
22 views

ReactJS - Best Practice For Saving HTML Snippets/Templates [duplicate]

Hopefully someone can point me in the right direction to the cleanest/most accepted way of storing HTML markup in React apps. Imagine my scenario: I have a country dropdown menu (<select>). ...
0
votes
1answer
12 views

Google App Scripts regex body.findText(searchPattern) function returns null

I have the following content in a google document, it's just text with some specific syntax: <li sheet="experiences"> {{company_name}}, {{job_location}} — {{job_title}} MONTH {{from}} - {{to}} ...
0
votes
0answers
12 views

CORS Error Using Spotify API Implicit Grant Flow [duplicate]

I'm getting a CORS error when I try and get an access token to the Spotify API. I am following the implicit grant flow protocol outlined in their tutorial. I am using a simple jquery get call to the ...
0
votes
0answers
8 views

In react-table, I've combined basic sorting and resizing examples but want to suppress sorting while resizing columns

I've combined both the most basic examples on resizing and column sorting. Right now, if I click on the resizing object (blue bar) in the below example, the column will both resize and sort. I would ...
1
vote
0answers
10 views

How to get the buttons in a 'dialog.showMessageBoxSync' to work in Electron.js

In my electron application, I have a .showMessageBoxSync message box with two buttons that displays if the user doesn't have a internet connection or not. The message box itself works, but the ...
3
votes
3answers
73 views

What is this called (JS)

var logic = { Rock: { w:"Scissors", l:"Paper"}, Paper: {w:"Rock", l:"Scissors"}, Scissors: {w:"Paper", l:"Rock"}, }; and it is used like: logic[playChoice].w === rndChoice Found it in a ...
-1
votes
0answers
32 views

How to count amount of items in an array?

Okay so now as you can see in the code you can add up to 6 of each item. When you hit 6 it says limit and it stops. What am trying to do is make the products and price of the code stop at 12 items. ...