Category "javascript"

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

If there is an active class on two buttons, how do I add a function specific to the buttons with the active class?

This is my first time posting and I'm also very new to javascript. I've had this problem for days and have tried various solutions but none have worked. I have

How to return the response from an asynchronous call

I have a function foo which makes an asynchronous request. How can I return the response/result from foo? I am trying to return the value from the callback, as

How to pass id in path url as component property in react router v6 [duplicate]

I'm updating an outdated tutorial project using react hooks and react router v6. I want to pass the id in the path url to the component proper

Bootstrap 5 Show Modal Code Behind (Asp.net C#)

I tried everything but I couldn't success it. <script type="text/javascript"> function openModal() { var myModal = new bootstrap.Modal(doc

Would like to write a javascript that helps me to find documents in a folder

I would like to write a js for an offline website (located on a local Windows server or any other server). It's supposed to look for files like PDFs in several