Category "javascript"

JQuery to prevent an element from getting focus?

How to prevent an input element (text, text area, select, radio button, checkbox) from getting focus? I basically want to make them disabled without changing di

how do I use for loop inside script tag in ejs

I try to draw chart, using chart.js. To get my data, I try to use ejs tags for example, in ejs I input html like this, and it works well. <p>date

How can I use moment.js to add days, excluding weekends?

I'm setting a default follow-up date two days from current date, which currently works: const Notify = moment().add(2, 'days').toDate(); However, I would lik

Express res.download()

I don't know why it's happening, but it's really annoying. I expected the file to be downloaded according to the express docs. I have the next code: //in rea

AppLab error e.replace is not a function when reading from data set

function Checkout(Payment_Type, Tip_Amt){ var Cust_Order = []; readRecords(Order_Data,{},function(Rec){ for (var i = 0; i < Rec.length; i++)

How can i do npm module support import and require?

I uploaded my first module to npm in Javascript and I want it to support import and require. Is this possible? The module is this: https://www.npmjs.com/package

Ag Grid React. Master Detail Chevron Doesn't show if grid has a rowModelType of viewport

I've added props necessary to enable the master detail grid (i.e. masterDetail, detailCellRenderer, and frameworkComponents). The master detail grid functionali

Call api before first render in functional component in React.js

If I want to call API after the first rendering of component, I know we have useEffect hook to call the API method. (I am talking about functional components on

Static Call Graph analyzer for Javascript

I can't seem to find a basic piece of tooling which is a static analyzer that shows me which pieces of code use methods from which other pieces. I could even do

How to run a test multiple times in Cypress.io

I have a test case to fix a bug that appears 1 in X times. I'd like to run the same test multiple times but I can't find any documentation that explains how to

Query-selecting elements from multiple elements, efficiently

Say you have an array of elements and you want to get all the <p> belonging to the elements in the array. I can see two possibilities: Run Element.querySe

Awaiting localhost to reload in ASP.NET Core

I have an ASP.NET Core server, which is using SignalR to generate HTML pages dynamically at runtime through JavaScript. After i shut my application down, in the

Random "Assertion failed" errors on Apple M1 chip

I have just switched from Windows 10 to Mac OS running on the latest Apple M1 Silicon. This is my first project on the Mac, I installed homebrew and used it to

React — Passing props with styled-components

I just read in the styled-components documentation that the following is wrong and it will affect render times. If that is the case, how can I refactor the code

Uncaught ReferenceError: getAuth is not defined

Self taught coder here. Hopefully I'm explaining the issue adequately. I'm trying to create some user authentication using firebase. I keep getting an error say

JavaScript Concatenate Nested Objects Spread Operator

I have the following example code. var myObj1 = { name: { first: "First", last: "Last" } }; var myObj2 = { name: { first:

D3.js ResizeObserver rendering issue. Axis not removed after resizing

Been experimenting with ResizeObserver in D3, the issue is that when the axis re-renders it leaves the old render behind, leaving a 'trace' of the previous axis

React useCallback with Parameter

Using React's useCallback hook is essentially just a wrapper around useMemo specialized for functions to avoid constantly creating new function instances within

Activate method on router link click in Vue

I am working on account removal on a Chrome extension and I have the following button: <button @click="remove" id="button_remove" class="btn btn-default" sty

Get content of span

how can I get the contents of span ? I'm looking for a way for all of this to be vanilla, not jQuery javascript (and a little jQuery) var swear_words_arr=new