Category "javascript"

Styling List with React PDF

I have created a small React app to test out React PDF. When the download link is clicked it creates the pdf as intended. My problem is that I have created a Di

Remember/maintain navbar scroll position between pages ( Javacript )

I have a vertical navbar on the left side of my page like this: $active = basename($_SERVER['PHP_SELF'], ".php"); echo '<ul id="navbar"> <li i

html 5 drag and drop not working on mobile screen

I am creating a scenerio in which I want a component of drag and drop, and I found one after some work around, which looks like the following function allowDr

Playwright JS - How to globally define/change timeout if element/selector not found?

Basically I want playwright to wait for each element 5 seconds if element not found. There is a way to change timeout individually as given below: await page.wa

V-model and TinyMCE doesn't work together

I'm trying to get Vuejs and TinyMCE to work together. I use @tinymce/tinymce-vue package which is the vue integration for TinyMCE. I had followed all the instru

Javascript input value of search bar not updating

I've created a search bar on my site with the code below. For some reason the value is not updating when the user clicks on a name in the dropdown options of th

Doesn't nextjs in vercel support Optional Chaining?

I see nextjs does support Optional Chaining here however, I've been trying to deploy this piece of code module.exports = { experimental: { outputStandalon

How to use document.getElementById() method in TypeScript?

I am trying to reset HTML Form in order to clear all the values in the input fields using; document.getElementById('myForm').reset(); But I can use that in

How to call different functions for different targets using an Intersection Observer?

I'm using the Intersection Observer API on a site. For every instance of using it, I'm using the same config (main viewport). My issue is that I need to have di

HTMX, Django - update part of page

I've started with HTMX and I want to use it to refresh part o page after pressing button on pop-up page. The button is adding clicking user as participant in an

Lost intellisense for cypress in visual studio code

I got a very strange problem. I created a cypress project very basic and simple one, only examples test cases and did not have any other devDependencies only

Testing randomness function without intended mean

I have a program that tests a randomness function for how truly random it is: function testRandom(randomF, tests, intendedMean){ let total = 0; fo

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