Category "javascript"

getElementbyId does not work and returns null

When accessing the site, the image and characters are displayed for a moment with JavaScript, It takes a lot of time to load the image, and we have to lengthen

Do JSON-Web Tokens (JWTs) cover both authentication and authorization?

I am researching on how to create a blog website that allows a user to sign in and based on his/her user role they can edit blogs, delete blogs, etc. but only i

React Navigation crashes when rendering

I'm getting an error while rendering navigation container. I just installed the project with the step by step getting started guide. but still I'm getting an er

Sending a message from one Websocket connection another existing Websocket connection from another server

I am new to WebSockets and NodeJS and experimenting with realtime chat application using NodeJS and WebSockets. Here I try to understand how I can scale my appl

Unexpected identifier and Unexpected token export when using babel standalone

I was trying using 'Babel standalone' to import module but getting Unexpected identifier and Unexpected token export, I can't figure it out why. Importing is fi

input text animation not working on focus out if there is no text

I have a problem with my search bar When the user clicks on it, it expands with a simple animation in order to allow the user to write, and it should play the a

Is Chrome’s JavaScript console lazy about evaluating objects?

I’ll start with the code: var s = ["hi"]; console.log(s); s[0] = "bye"; console.log(s); Simple, right? In response to this, the Firefox console says: [ "

Why is the minimal value greater than zero? [duplicate]

I was just testing numbers in JavaScript when I noticed something weird occurring. Why is Number.MIN_VALUE greater than 0? I expected it to be

How to fetch discord member list

I'm trying to fetch the member list of a discord server. The Discord bot is inside the server and has admin permission. I'm referring to this part of the docume

is there a way to use socket.io in a local area network without connection to the internet

I built a flask chat app that uses socket.io to handle user to user communication. My problem is that the app is supposed to be working only in a LAN and when I

Dynamically adding rows to DataTables

I'm trying to add dynamic a row on https://DataTables.net . I understand when I set processing: true , serverSide: true and ajax, I can't add new row in the tab

Detect multiple tabs opening... and close the newest tabs! (via BroadcastChannel API)

I've put this function on load so I can detect a new tab being opened: function checkNewTabs() { const channel = new BroadcastChannel('tab'); channel.postMe

How to resolve "Did you set the Font Awesome icon font size inside the body of function?" error?

Can someone please tell me why, when I test the code, I get an error that the code has failed even though everything is working properly? I get the same error f

Detect multiple tabs opening... and close the newest tabs! (via BroadcastChannel API)

I've put this function on load so I can detect a new tab being opened: function checkNewTabs() { const channel = new BroadcastChannel('tab'); channel.postMe

Test onClick of a button is called when there is no props passed down to it using testing library react and jest

I have a component for an upload button which calls the ref of an input when clicked: import { useRef, FC } from 'react'; import Button from '@mui/lab/LoadingBu

How to run a single-file javascript soundboard app from Rails 7

I have a single-file Javascript soundboard application from app academy. The code works fine, but how do I "wire" it into the Rails 7 server? I'm struggling to

Getting data attribute from root in ReactJs

I'm trying to grab the attribute listed in the div being rendered but it returns undefined. Any idea on how to go about it will be greatly appreciated index.htm

Update one property in MongoDB and update UI without refresh the page

I am trying to update one property Like I have a few properties, product name, price, quantity, supplier, and description. I am sending all the updated quantiti

div array won't close when external close button div is clicked (Javascript)

I'm actually occurring a situation when making an accordion. I already add a close button (x text) inside my div to close the accordion, but it won't close afte

moment.IsSame returning wrong result

I am using the moment isSame which is returning false for two dates which are same, moment(new Date('2070-07-27T21:59:59.999Z')).isSame(moment(new Date('2070-07