Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Browsing all 138134 articles
Browse latest View live

React-Router not receiving props if it's the same path, but different param?

I have a path /player/:id/If I navigate from say /player/12 to /player/13 it will error out, for example: cannot find foo of undefined. However if I navigate from a different path such as /heroes/100...

View Article


MailChimp. Error 401 (Unauthorized) when sending a request for adding a new...

Here is how I'm trying to send a request:fetch('https://us17.api.mailchimp.com/3.0/lists/185415c92c/members', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization':...

View Article


React Dropzone Uploader not playing along with form upload to mongo

(New to stackoverflow so please correct me if I've seemed to miss something from CoC) (Unfortunately wasn't able to tag this under 'react-dropzone-uploader', since I don't have 1500+ rep points)I'm...

View Article

Why is only one property being printed

I'm working on a project with Google Apps Scripts that use the scriptProperties service to save text a user inputs and print what was input last when the program is opened later. The problem I'm...

View Article

Javascript function to convert decimal years value into years, months and days

I need a function to transform decimal values of years in years, months and days. Ex: 1.5 years = 1 year, 6 month. 2.2527397260273973 years = 2 years, 3 months and 1 day.I started with this...

View Article


String and number concatenation

I have this little script that adds a a certain increment to numbers from text field. I have two text fields, Text1 and Text2. Text1 takes the input numbers,the function adds a plus 6, ie makes a 4 a...

View Article

Struggling to render multiple components onto a page using a function + for loop

I want to render components into my React app using a for loop inside of a function.But when I add n > 1 number of components to the variable I am returning inside of the function, the page ends up...

View Article

How to return a value from a PouchDB database?

I am working in a React-Native project (JavaScript language) with a PouchDB database. A have a specific file for database functions and one of them is:export function getStratumName(columnId,layerKey){...

View Article


Image may be NSFW.
Clik here to view.

Input type="file" data empty when posted

I'm working on a Vehicle damage form where users can click picture of their vehicle. How it works?They choose a description of the photo they want to click.Then they click on Add buttonI append input...

View Article


Tweet API Discord.js

const Discord = require('discord.js'); const Commando = require('discord.js-commando'); const Twitter = require('twitter'); const config = require("../config.json"); const clientTwitter = new Twitter({...

View Article

Image may be NSFW.
Clik here to view.

React native DatePicker component: the wanted date disappear?

mycode <DatePicker style={{width: 170}} date={this.state.date1} mode="date" placeholder="select date" format="YYYY-MM-DD" maxDate="2020-01-01" minDate="2010-01-01" confirmBtnText="Confirm"...

View Article

Non-capturing group matching whitespace boundaries in JavaScript regex

I have this function that finds whole words and should replace them. It identifies spaces but should not replace them, ie, not capture them.function asd (sentence, word) { str = sentence.replace(new...

View Article

How to center the whole image comparison slider

When I manage to move the image comparison slider, the actual 'slider' left behind. The slider JS code is from https://www.w3schools.com/howto/howto_js_image_comparison.aspand can be easily inspect...

View Article


How to fetch data (method call) every five seconds in Flutter?

In JavaScript, I could constantly fetch data without an explicit request from the user by calling a function fetchData() every five seconds using setInterval(function() { fetchData() }, 5000); and this...

View Article

JavaScript not working after GitHub deployment

I am trying to host my developer profile on GitHub. I have a small javascript typing project I am working on that gets a quote from an API and lets you type the results showing your errors and WPM. It...

View Article


Format input with regex

I have a input field which is a percent value, i am trying for it to display as % when not focused in and when focused in it will loose the %, also the input field needs to avoid chars on it. I'm using...

View Article

How to check empty/undefined/null string in JavaScript?

I saw this thread, but I didn't see a JavaScript specific example. Is there a simple string.Empty available in JavaScript, or is it just a case of checking for ""?

View Article


Access model property from javascript

I have an ASP.NET MVC project and I am trying to access a model property (isNew) from the view (.cshtml) and from within javascript function so I am performing below without success:@model...

View Article

displaying modal image from loop, function in javascript

so i am trying to display some images onclick function, which comprises of many clickable images. Problem is that i made the thumbnail images from an arrayloop in php. Found a way to set distinct id...

View Article

Node.js - How to hide html pages?

I have html pages which shouldn’t be seen by the users who haven’t logged in. I used the command below and my html pages became public.app.use(express.static('public')); For example, I do not want...

View Article
Browsing all 138134 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>