Category "javascript"

Difference between this.variable and this._variable in JavaScript?

I'm learning the Codecademy Advanced JavaScript course, I'm learning about classes. In their code, I feel this.variable and this._variable have no different but

Paste test in cypress in reactjs project

Any ideas how to simulate Paste action in Cypress in a bundle with React? My test should check value right after paste action. I found few solutions based o

How to stop a setTimeout loop?

I'm trying to build a loading indicator with a image sprite and I came up with this function function setBgPosition() { var c = 0; var numbers = [0, -12

is there a way to implement react scroll along with react router dom?

I have a navbar with links that scroll to sections of page using react-scroll. i also have several pages and im using react-router-dom for navigating between pa

How to sort array of objects by dates and make new arrays which will contain all objects with same date [closed]

I have a very specific problem in Javascript. I have array of objects, and each object contains some date. const array = [ {name: 'first', dat

CKEditor 4 works but CKEditor 5 doesn't

This works : <!DOCTYPE html> <html lang="en"> <head> <title>CKEditor Classic Editing Sample</title> <!-- Make sure the

How can update values in an array of objects?

how to get new array newSelect using map ,forEach const selects = [false, true, true, true, false]; const oldSelects = [ { select: true, name: 'AA' },

Is there a way that I can run only Cypress tests specific to the application files I changed?

I would like to run only specific Cypress tests related to the application files that I changed, but every time that I make a change all the integration tests a

InnerHTML doesn't work with if condition in regExp [closed]

i'm trying to add some confirmation to my form using RegExp The thing is that i use some condition in that way i can show to the user that the

Problem tying a variable to a boolean in P5JS (Simple bouncing ball exercise)

TL;DR Why isn't the ball bouncing off of the edge in the link below? I'm currently going through the CodingTrain P5JS videos. What I'm trying to achieve is a si

Alert message after submitting form in PHP

I'm using form with POST method to apply session, once the form is submitted the page reloads and I can't have any alerts on the screen. So I've used some tric

How to define `name` and `inheritAttrs` in `<script setup>`?

Options API: <script> import { defineComponent } from 'vue' export default defineComponent({ name: 'CustomName', // 👈 inheritAttrs: f

Why I can't install React and uninstall create-react-app in my system?

I have tried so many ways. But I can't find any solution. The problem is I can't install ReactJS in my system. Here is the message I get when complete my instal

Problem with FastAPI patch request from Javascript

I made a REST service on python using FastAPI and I need to call the API using Javascript. This is my FastAPI server: class FieldUpdate(BaseModel): item_id: Opt

Properly parsing mixed codepage strings?

I have this weird state that my db got into. Basically, some text is in mixed mode. windows-1252 and miscoded utf-8. Here's a sample: "donc d'être transpa

plotly is undefined in react

i am creating a weather app in react which shows the weather forcast in a graph using the api but i am getting an error plotly is undefined although i have past

Print file on client side

I am using FileSaver.js to print an object array on the client side (HTML/Typescript). var blob = new Blob([JSON.stringify( marray)], {type: "text/plain;charset

Javascript tree adding and deleting object or children by key in array

I'm trying to make file stucture tree and got some problems. And then draw it with ant design tree. Having some problems with functions to update data on my rea

Unload/remove/disable Google Analytics dynamically without a full page load

I see various guides on how to add Google Analytics/ GA into a page dynamically, e.g. for a Single Page Application/ SPA. How can I do the reverse, i.e. a user

Angular 13 Property does not exist on type 'FormGroup'

Good evening everyone! I'm having a few issues with Angular lately. I'm new to Angular, so I'm encountering lots of errors here and there. Thankfully, I've got