Category "javascript"

How to run this jquery function only on desktop

I'm a begginer in Javascript and I kindly need your help with this Jquery script I'm working on.. I need to make it work only on desktop and prevent it to run i

Google Spreadsheet: Hide/Unhide any row that meets x condition in a group of rows when clicking button?

When clicking "button1" I would like the code to check the First Cell (Column A) of Rows 38-58 and hide the Row if the corresponding cell is empty and show if i

Are there any performance issues with inlining CSS rather than using "chunks"?

Modern frameworks like Vue and React start with inline CSS inside individual components. For example, in a Vue single file component, we include all the Javasc

Animation to center a div in the window

Hi I need an animation that makes a div go from left to center, but it doesn't work. This is my code: $(document).ready(function () { $(log).click(funct

Looping in a complex JavaScript object

I have an object like this const countries = { iran: { capital : 'Tehran', population : '83183741', area : '1648195' }, uk: { capital

I'm making a Wordle game with Javascript, but I've come across an error that I've been struggling with for hours

I'm making a Wordle game with JavaScript. However, the ID in the UPDATE function doesn't work even though the ID I used before is full. I tried changing the id,

Adding Images from a image folder dynamically to a div box

I'm trying to create a random number generator where based on the number an image is chosen from the img folder that is on the same hierarchy as the CSS folder.

Chart.js Uncaught TypeError: Cannot read properties of undefined (reading 'options')

Edited the Details as I found a solution to display the Chart with the right datasets. Code Below will show the Two Charts, which visually looks great but butto

Getting error while verifying phone number in firebase (angular project)

I am working on an angular project, where I am adding MultiFactor Authorisation using firebase authentication, I am trying to verify phone number by firebase.au

JSF <f:websocket> connection fails (Jakarta EE9, JSF 3.0)

I am trying a simple websocket application using Jakarta EE9 and JSF 3.0 on a glassfish 6.2.5 server. When I run it, messages are not received, when the server

Get remaining days, hours, minutes, seconds to date with date-fns

I want to get remaining full countdown of next instance of weekday (for example next Thursday), I have two functions: FIRST: gets instance of next Thursday SECO

What does () mean if set as a interface property?

In the Vue.js source code (packages/reactivity/src/effects.ts), I found this: export interface ReactiveEffectRunner<T = any> { (): T effect: ReactiveE

Run setTimeout with changing time values

I have an array of objects containing a field duration that specifies the duration that the Object should stay visible. Each Object of array has it's own durati

ngSubmit not working (Following Traversy Media Angular Crash Course)

My ngSubmit is not working. The problem is that I am trying to follow Angular Crash Course this tutorial at 1:30:00 mark he tries to add in onSubmit alert and I

How to prevent WebGL from clipping outside bounds when drawing a wavy circle?

I have a shader that draws a bunch of instanced circles, and it works great! It works by basically drawing a bunch of rectangles at every given location, and th

How can I get the indexes of a filtered array items

I have this situation, I have an array and I need to filter it and get the indexes of the filtered items, like this example: var arr = ['2022-05', '2023-01', '2

Passing FormData/File Object from content script to background script in chrome extension with Manifest V3

I'm building a chrome extension where I get a file as input from the user and pass it to my background.js (service worker in case of manifest v3) to save it to

Telegram bot and google apps script not working

Good evening everyone, forgive the trouble, I tried to do a "search" on the site but I could not find the answer to my problem so I thought of opening a new dis

Stored Procedure Snowflake - time formatting issue

var get_end_time = "select CURRENT_TIME()"; var time_sql = {sqlText: get_end_time}; var time_create = snowflake.createStatement(time_sql); var time_exec_end = t

Display data after POST request without reloading page

I have this node.js app where you can post comments on teachers profiles. teacher.ejs <!-- Form --> <div class=""> <form id="commentsForm"