Category "javascript"

Get IPv4 Address using JavaScript on Safari

I'm creating a web application and in order for it to run, you must have your device 'registered'. The registration process involves entering the IPv4 address o

How is hardhat implicitly knowing deployer address?

I am new to using hardhat and I was trying to figure out how it is working. The documentation seems a little bit fuzzy as there are multiple layers of abstracti

Using baseUrl in jsconfig.json is not working with Next.js

jsconfigerror is an example repository showing the jsconfig is not working. I have the following set inside my jsconig.json file: { "compilerOptions": { "

How can I get the weekday from an users input date?

function date() { var input = document.getElementById("input"); } <form> <input type="date" placeholder="dd:mm:yy" id

Why does my React Router return blank pages?

I am using the latest version of create-react-app. I have searched all tutorials and tried a few websites with different tutorials but I am not getting errors.

Using Firebase Auth & gAPI?

How do I get Firebase Auth to work with Google drive api? Using react, I have firebase auth working and google drive (gapi) both working individually but am str

Regex for getting region and lang from url /xx/xx in two groups

I have a url structure where the first subdirectory is the region and then the second optional one is the language overide: https://example.com/no/en I'm trying

In Material UI v3.6.0 Select Dropdown div flickers / triggers twice

When i am providing less than 100 items to the Select Dropdown its working fine but if i provide more than 100 then the Dropdown flickers/triggers twice. I have

How do I average the elements that are above a threshold in an array?

I am trying to average all the elements that are above 150 in an array. I can't figure out how to make it all work out and output the correct numbers. Can anyon

Scroll Snap Breaks Smooth Scrolling

I am trying to make a page with scroll snap as well as smooth scrolling when you click on a link but scroll snap seems to break smooth scrolling. On iOS it brea

How to test an exception was not thrown with Jest?

The Jest docs do not demonstrate a way of asserting that no exception was thrown, only that one was. expect(() => ...error...).toThrow(error) How do I asse

How to import internal css conditionally with javascript vuejs?

Currently, I have to import css file conditionally depend on which kind of browser users are using. To not making css file global, I have the following code:

How do I average the elements that are above a threshold in an array?

I am trying to average all the elements that are above 150 in an array. I can't figure out how to make it all work out and output the correct numbers. Can anyon

node-mssql Transaction insert - Returning the inserted id..?

I'm using node-mssql 3.2.0 and I need to INSERT INTO a table and return the id of the inserted record. I can successfully use sql.Transaction() to insert data,

Error: ENOENT: no such file or directory, open When trying to access a directory with fs

I am not knowledgeable in nodejs or express, I have an API running on http://localhost:3000 and one of the endpoints call a function that uses file system to re

Run Jest tests only for current folder

I have Jest installed on my machine and typing jest from terminal results in tests from parent folers also getting executed. I want to run tests only from the c

Google oauth 400 response: No 'Access-Control-Allow-Origin' header is present on the requested resource

I'm trying to make request from client-side javascript to the google oauth endpoint (https://accounts.google.com/o/oauth2/v2/auth) with a google calendar scope.

JQuery click event for multiple elements with same ID

I have HTML page having below structure of div elements. <div data-videos-list="listelement" id="band-comments-div"> <label> <!-- Some code

how to get clicked value and pass it to another jsp page (integer)

I am working in a project in which I have a Display.jsp page which fetches all the records from mysql database and shows in a table on the page. While I want to

Node.js: can you use asynchronous functions from within streams?

Consider the following: var asyncFunction = function(data, callback) { doAsyncyThing(function(data){ // do some stuff return callback(err) }) } fs.