Category "javascript"

How can I print a function from JavaScript to html

I'm trying to make a out of '*' and I got the code right because it works in the console but when I try to print it in the html document it does not work functi

Capture Errors From Embed/Iframe

So I'm building a React application for a client and they want me to find when a user is not authenticated, and redirect to a different site. When the user is n

I used fetch() method to load data from external server. All data are being loaded properly. But I came across dificulity when I use querySelector

I'm trying to load data from an external server and render it on my web page by using javascript. I used fetch(url) to load the data. Data is being loaded prope

NextJS: Error serializing `.data.data` returned from `getServerSideProps`

I'm new to NextJS. I'm working on a simple page in which I need to retrieve data from my backend app. My backend app is a totally separate app written in go. My

AntD React InputNumber Increase/Decrease buttons appear to start infinite loop

I am experiencing some unusual behaviour with AntD InputNumber component, specifically using the up/down incrementation buttons: I have a very basic implementa

How to fill all fields using puppeteer?

I use page.type to fill a field using puppeteer. If you have a multiple selector, then it will fill the first found field. My goal is to fill all inputs that ma

How to set a multiple arrays in javascript

I run into a problem wherein I want to divide my items in by array likes this [ 1 [ 1[[1][2]] 2[[3][4][5]] ], 2[ 1[[1][2]] 2[[3][4][5]]], 3 [ 1[[1][2]]

How can I make the menu folding/unfolding function? (double layer)

I'm making a menu folding/unfolding function. When there is one submenu, it is completed, but the problem is when there are two submenus. When you unclick a men

How to add a class to a given element?

I have an element that already has a class: <div class="someclass"> <img ... id="image1" name="image1" /> </div> Now, I want to create a

How to set a multiple arrays in javascript

I run into a problem wherein I want to divide my items in by array likes this [ 1 [ 1[[1][2]] 2[[3][4][5]] ], 2[ 1[[1][2]] 2[[3][4][5]]], 3 [ 1[[1][2]]

Debugging undefined is not an object (evaluating 'Object.keys(routeConfigs)')

I'm using Expo and React Native to create a simple iOS app. I am currently getting this error and have no idea how to fix it. I've tried various other solutions

How to handle React props correctly

I posted this here because I am relatively new to React and didn't know what exactly should I google. In my React project, I have a kendo grid that has a custom

Discard audio before certain time from Hls.js stream

I am using Hls.js to live stream an audio feed into an audio element in my HTML. In my custom audio controls I limit the user to only be able to scroll back to

Generate chart in table cell according to json values

I need to create a bar or column chart inside a table cell of each row. i.e I need a graph to be populated for each category inside table cell. JSON: [ {

How can I add a cover image to a Discord Scheduled Event?

I have created an event through the Discord JS Library, and would like to add a user option to add a cover image. The code below is working fine, but the image

Add an opacity slider to a leaflet map generated in r

I would like to add an opacity slider to a leaflet map generated in r. It should change the opacity of the uppermost visible or all visible layers (either of th

How to .map around things inside another .map

I have a main array of options and inside it there are array of values, I am using vanilla js and want to map around the first array (options) and then inside t

Build a dynamic interface for Object in angular

I have an JSON Object received from an api call and the Object will have multiple values but all of type string. How to I write an Interface for such an Object

How to calculate a mouse position like 0 will return -8 and 1000 will return 8 number?

As I'm trying to get into animation using a mousemove event I encountered a problem on how to get the specific number with a limit in both left and right direct

How to global import a stylus file in vite

Now I'm try use vite to create a vue app. But have trouble to global import a stylus file in vite.config.js. I try the code from vite docs. export default defin