Category "javascript"

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

how to handle lazy import in functional component react js avoid import befor need to render

Get data from multiple form it causes load more and become slow. How to avoid import or run code before render the element. Here the below code run both element

Trying to Populate a Grid of Coordinates into a Multidimensional Array Using Nested Array Map Methods

I'm trying to populate a grid of coordinates into a multidimensional array using ES6 nested map methods using this code: var gridSize = 4; var regionA

Is there a better way to refactor this function using the Lodash library?

My goal was to take a list of blogs and find the author with the most blogs returning an object like this { author: String, blogs: Number }. I was successful, b

Chart JS Tooltip Currency Problem - Stacked Bar Chart

I use ChatJS and i want to add an € Symbol after every number in the Tooltip. On my most charts it works perfectly but the Stacked Bar Chart makes me probl

Run function only once for particular element [duplicate]

I am building a simple todo app and I am new in JavaScript and I am stuck in a problem. I am trying to run function only once for a particular

vuejs3 : can't import axios globally

I can import and use axios in a component: import axios from 'axios' export default function usePostLogin() { const login = async (url , data , callback) =>