Category "javascript"

Type Error: How do I get a method to execute like a function in Javascript?

I was trying to create a Javascript function in HTML,which should create a rectangle and set the size to the likings of the user with this code: class Rectangle

How to set the default value of Date Range Picker to null

I am using Laravel framework. I want to create a date range filter using ajax. but I have a problem with the daterangepicker that I use this is my view this is

clone select element and selected options are disabled

the scenario is when all the selected options are there. so, the option is disabled. but when I clone select options and then disable not show in options. in t

advanced hover button

I have no idea how to do this effect.

Vue.js: How to add static data between fetched data?

For my application I want to add advertisement banners after every 5 items in my data. So when you scroll you see five data items that I fetched, 1 advertisemen

Import.meta.env undefined on production build vitejs

I am using vitejs to compile my react app statically, however after build .env imports become undefined which is not the case on development stage. reading the

anchor test command error - Error: Cannot find module '[@project-serum/anchor] ' Please verify that the package.json has a valid "main" entry

I was following an introduction tutorial using anchor (solana framework), it is based in the official github. In the testing part, I used anchor test command an

Unexpected token u in JSON at position 0 Error in JS

when i execute this JSON.parse(ArrayBuffer); I have this Error : SyntaxError: Unexpected token in JSON at position 0 Thanks for you response

CORS error with OPTIONS request using AWS CDK

I am using AWS CDK to run a RESTful API and I am getting the following preflight error when calling a POST endpoint: Access to fetch at 'http://localhost:4000/

How to clear a React Bootstrap textarea form control after the form is submitted?

I have a form made with React Bootstrap to semply submit a string that will be saved on a DB. It works and the submitted message is saved, but I don't know how

How do you extract an array or count the elements in Javascript if we don't know how big is it?

I have an array like this: const fruits = ["apple", "peach"] And I have a second array like this: const sold = [ ["sold", "not"], ["not", "sold"], ["sold", "no

Javascript code broken in firefox browser only

I created a div C. Its absolute position is setted to stay between the bottom margin of div A and top margin of div B. Every div is a rectangle with same width.

How to ng-repeat this table row and increase the ng-show row position value instead of hard coding the values

I am working on a feature which allows a user to create their own table. I'd like to refactor this code. So it creates a number of rows based on the max rows I

Click event not updating global variable

I have a website with 2 pages. In the first page (landing page), I have this clickable element: <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12" id="arrest-

react conflit package.json

ERROR in Plugin "react" was conflicted between "package.json » eslint-config-react-app » D:\Projets\Roster's\Client\node_modules\eslint-config-reac

Photoshop change top text layer name to same as file name

I have 1000s of psd file to change top layers as file name. Please help me to crate a script for this. I want to have a JS-Script, which changes the Text of the

How to change from page-2.html the option from dropdown menu with onclick function from page-1.html

I want to split the below code to two pages instead of one page. The code you see is inside to page-1.html. When you click the link "set to val1" the dropdown c

attributeChangedCallback() always called twice ending up with multiple event listeners

Playing around with custom elements, I'm trying to get a click event fired depending on custom element attribute's value. But using the attributeChangedCallback

Ineffective mark-compacts near heap limit Allocation failed error when building next.js app

I have a next.js app running inside a docker container in a EC2 instance. When I run docker-compose up this will trigger the next.js app to be built. Now it is

How to flush promises since Jest 26+

Jest 26 shipped a new implementation of fake timers based on @sinonjs/fake-timers. Previously I used const flushPromises = () => new Promise(setImmediate); a