Category "javascript"

How to reference image in an array?

I have some data im using in an array that looks like: import image from "./image.jpg"; export const data = [ { id: 1, title: "kevin", content: `G

Material-Table columns not resizable with more than 5 columns

I am displaying data using material-table. I have 19 columns to display and I want to set a fixed size for each column. Using width: 45% is not making any vis

running websocket in google sheet without using HTML code

I find this test for Binance websocket in app script the code in this URL: running websocket in google sheet I want to remove code HTML and run websocket withou

How can I check a valid user's phone number in JavaScript?

I am creating an input form on a web page. That's on field in phone number get in user.now How can I check now if the user's phone number is a wallet? my user l

getting video length of mov file with no audio error chrome js

Is there an accurate way to determine the length of a .mov file with chrome? On our website we currently use video.onloadedmetadata but it's causing errors. Exa

How to save the opened tab state in vue.js? (script setup)

How can i save the state of opened tab while refreshing? I have two tabs If I opened 2nd tab and than i refresh, it took me back to 1st tab. My code is <temp

Can we edit title of windows alert box being used in Google Apps script?

Can we customize the title in alert box for a webapp created using google apps script ? function confirmReserve(text){ document.body.style.cursor = 'auto';

TypeError: Cannot read properties of undefined (reading 'add')

I've been stuck on this for ages and can't figure out why the error pops up. async function verify(i) { try { var g = await client.guilds.cache.get(

Why does jQuery or a DOM method such as getElementById not find the element?

What are the possible reasons for document.getElementById, $("#id") or any other DOM method / jQuery selector not finding the elements? Example problems include

Unable to run unique iterations for individual objects

I'm trying to present 25 entries (name, company, skill, etc.) on the page and am having trouble getting the unique information. i.e. I only see the first entry

generic type to add missing properties in type

I have the onMessage function that gets events from SDK of the third party in my app interface TypeA { a:string, b:undefined } interface TypeB{ b: '

Circle drawn in Openlayers not changing properly

I have a JS file that allows me to draw a circle on an interactive made with Openlayers 4.6.5. The problem I currently have is that once the circle is drawn, I

Update Azure Function Node.js Version, avoid downtime and lost messages

I have an Azure Function App hosted on an Elastic Premium service plan. It triggers from coming Service Bus messages. I need to upgrade the Node.js version from

havie been using js fetch api to post data from the cllient side to the server side in django but its not been posting

haven been trying to fetch data from client side to the server side(url='/update/' using js fetch,been getting the response but the data is not being posted to

Create new productpage when new database entry

How can I create a new page when I enter a new product in my database, or hide the parameter inside a normal /.../ ? In this example I will sell Sandles with th

JavaScript Google Map API: add marker to the map without new a google.maps.Map object

I found that every time I want to add marker to the map, I have to new a map, which cost money. So I tried to define map outside function. The pseudocode looks

How to play sounds correctly?

I need to run sounds automatically in React. In order to run sounds, I use a non-standard useSound hook. It creates a button and by clicking on this button the

How to get value of input tag that changes?

Basically, I wrote this function in JavaScript: <script> function getVal(value) { console.log(value); } </script> And this is my HTML input

Mapping canvas LinearGradient to an image

function show(d) { function normalize(val, max, min) { return (val - min) / (max - min); } var canvas = document.createElement("canvas") var ct

How to make back to the top anchor link smooth scroll

i'm trying to make the back to the top button on click to be smooth scrolling but i'm stuck.. at the moment this code works but its not smooth scrolling to the