Category "javascript"

Is it good practice to use razor pages directives inside javascript <script> tags to pass model property values?

I'm developing a web app using asp.net core MVC and I've found my self using razor pages directives to pass model property values to javascript for further mani

Should we be using the unsubscribe method returned by Auth.onAuthStateChanged() in firebase to clean up memoery leaks?

Here is my code: import React, {useState, useRef, useEffect} from 'react'; import { getAuth, onAuthStateChanged } from 'firebase/auth'; import { useNavigate } f

jQuery Performance Long Running Tasks

var data = response.Data; var table = $('#' + tableId).dataTable(); table.fnClearTable()

Dynamic Tabs content wont display simple data

Hi everyone i dont know what i am doing wrong the content in the tabs are not displaying the links menu works fine Just i dont know why the content is not loadi

Why would a standard top-of-file import to suddenly cause failing on `npm run build` but not on `npm run dev`?

The module in question requires this, which works for dev import { RRule, RRuleSet, rrulestr } from 'rrule' This results in the following error from npm run bu

Javascript doesn't run with both electron and canvas libraries installed

I'm trying to use electron and canvas in the same script, but it throws an error when I try. I've tried using canvas and electron separately with the same node

Script Google Sheets to generate Google Maps picture and paste it into a cell

I tried to take a code and adapt it to my needs but without success as I am new in script. This code allows to generate a google map with markers on several add

Change nested object with one function in react

I have this kind of object where I want to change the Ethereum value for example; const [reportData, setReportData] = useState({ nameOrganization: "test5",

Not able to push data to real time database with react native

I am using this code to push to a real time database with NodeJS and this is working fine import admin from "firebase-admin"; admin.initializeApp({ credenti

Mutation observer not being called when there's a change in Shadow Dom tree

i have a running extension where i use combination of mutation observer and tree walker to filter out text nodes and embed React component on that page where i

Uncaught TypeError: Cannot read properties of undefined reading pathname

I am getting this error while running the below code import React from 'react'; import { Link } from 'react-router-dom'; const DanimProduct = () => { re

What is the status of the 'default props rerender' trap in React?

I'm looking for a canonical reference to how this has been dealt with. If I have a component that looks like this: const MyComponent = ({ value = [] }) => {

React: React-Bootstrap Collapse is not working

Started using React-Bootstrap today and I want to make a collapsable card. Using Collapse component but it's not working. Any tips? My code: import { RiArrowDow

I want to create an object from two different object, one is parrent object and another one is supposed to be a child

I want to create a new object from two different objects with a relational field in the child object is Section__c in relation to the Parent object Id. My paren

Writing to a JSON file from an electron web app

Using electron I have made an app that can generate 6 arrays that create a frame for an animation, these arrays are going to be interpreted by another program t

Can't import the named export 'Directive' from non EcmaScript module (only default export is available)

this is a ionic angular project that i'm working on, i'm using ng-lazyload-image plugin Link. when i start compiling it showing errors like this. Error: ./node_

Adding an image while using mongoose Schema

How can I add an image to my mongodb when using the mongoose.schema in JS? const chequeSchema = new schema({ chequeImageUri: { type: Image, req

NodejS Read/Write Binary Data to/from file

Alright, so I have a string with binary data ("111011 10001 etc"), and I'm trying to save it to a file to them read it on another file using streams, the issue

Redux toolkit filter() not working when wanting to display new array at the same time

I am currently building a clothing shop in which you can add products to the cart, and delete each one of them as you like and it makes the cart re-render and d

How would I get the data I need from this array?

I am trying to get all the data from my firebase firestore and put it into a javascript react table but I am having a difficult time. async function GetAllDataO