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

How to replace useEffect hook with component lifecycle?

I'm forced to use class based component, so how can I replace useEffect with component lifecycle like componentDidMount, componentDidUpdate and componentWillUnmount in my React component. Please...

View Article


transform :translateY(-50%) not working properly

I decided to learn flexbox so I found this video (https://www.youtube.com/watch?v=Rf_DjL_dbug&t=3382s) and now I'm stuck. I did everything step by step, and when it comes to styling in CSS ( 50:40...

View Article


TypeError: Argument 1 is not valid for any of the 1-argument overloads of...

I've been using getUserMedia to access camera from the browser. I tried it on several browsers and it works except on firefox. It works on chrome,avast,opera mini. This is my code:<button...

View Article

URL.createObjectURL for audio blob gives TypeError in Firefox

I'm trying to create a Object URL from an audio blob created from getUserMedia. The code works within Chrome, but there are problems in Firefox.The error:When I call stopAudioRecorder() it stops at...

View Article

CSS to Display Post Grid in One Column Like the Image I added

Here is an example of the grid I need : 1: https://i.stack.imgur.com/fyOuz.pngi want to Display Post Grid in One Column in my mobile theme instead of the 2x2 grid. Every of the box will be aligned in...

View Article


Bind additional properties at instantiation

Let's say I have a class.class Room { constructor() { this.width = 100 this.height = 200 } } I would like to bind additional properties to it at instantiation.new Room.bind({ capacity: 5 })() Is this...

View Article

Encrypting large files using the WebCrypto API

I'm trying to encrypt big files (> 1GB) using the WebCrypto API. Encrypting small files works great but when I try to encrypt big files, my browser hangs and it seems the encryption is never...

View Article

How can I create service return values of longitude and latitude from json?

How to create service return values of longitude and latitude from JSON?I have the following URL:http://192.168.7.xxx:9200/location/_doc/27737 This URL JSON below:...

View Article


In JavaScript ES6, what is the difference between an iterable and iterator?

Is an iterable the same as an iterator, or are they different?It seems, from the specifications, an iterable is an object, say, obj, such that obj[Symbol.iterator] refers to a function, so that when...

View Article


Using JavaScript to calculate total of a form and radio buttons

How do i auto-calculate the total of the events, whether multiple events are selected or singular and if the delivery option is changed, then the total is placed in the total box automatically. Any...

View Article

Regex to replace multiple spaces with a single space

Given a string like: "The dog has a long tail, and it is RED!"What kind of jQuery or JavaScript magic can be used to keep spaces to only one space max?Goal: "The dog has a long tail, and it is RED!"

View Article

Javascript: 1 === 1.0000000000000001 //True 1 === 1.000000000000001 //False...

This question already has an answer here:Is floating point math broken? 31 answersAs stated in the title, when using the chrome console these are my results...1 === 1.0000000000000001 //True 1 ===...

View Article

Parsing an unabridged continous set of string values into usable indexable...

This is NOT a duplicate. I've already tried JSON.parse() and it doesn't work. Here's my question: the code provided in this crucial & helpful answer I got yesterday produces a result which I cannot...

View Article


Updating back of array without using push() in javascript

I am trying to update the back of an array WITHOUT using the push() function, so I decided to use the splice() function and pass -1, and 0, and then the value so that it would update my array at the...

View Article

Copy array by value

When copying an array in JavaScript to another array:var arr1 = ['a','b','c']; var arr2 = arr1; arr2.push('d'); //Now, arr1 = ['a','b','c','d'] I realized that arr2 refers to the same array as arr1,...

View Article


Laravel with ajax vanila javascript

i´m new use laravel, i´m try create an app of contacts to practice. How i can call the url or route the controller with javascript?, show my code for to explain me. I´m create new method in the...

View Article

Click on a day By Color

I need help to click the day (date) that has Green Backround with js ... Here's what I got on the HTML: <td style="width: 50%" id="caldiv"><div id="calendar" class="fc fc-ltr"><table...

View Article


Why JavaScript regex literal execution is slower when it is assigned to a...

My question is related to a previous Stackoverflow post, which says the following two ways have almost the same speed. But when I test it actually using loop count 1000000, there seems to be a...

View Article

Regular expression to remove time from time and date

I am trying to remove time out of a scraped date and time field so i can sort the data by date. Here is a sample of what the data looks like:12/21/19, 3:02 PM I am trying to use a regular expression to...

View Article

Could using native browser modal dialogs in a loop lead to potentially...

I was trying some code at JSBin and got weird results. This should work - it's a simple loop that uses Window.prompt. It does execute the correct number of times using Stack Snippets:for (let i = 0; i...

View Article
Browsing all 139805 articles
Browse latest View live


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