Quantcast
Channel: Active questions tagged javascript - Stack Overflow
↧

Unable to connect to Postgres database in JavaScript file

I'm currently using Neon Postgres, which works perfectly fine, when I attempt to connect it directly from Windows.However, as soon as I go to WSL, and try to connect using the pg client, I get the...

View Article


How to select a list of names and control the display of a div?

I have a list of names (ul, li elements) and a hidden div on topWhen a name is clicked (selected), the background color of the name should change and the div on top display block. Only when all names...

View Article


Is possible scroll div when mouse over button which placed in right bottom...

I have two blocks that are in the parent.The first is a block with a button inside, which is absolutely positioned and is located in the lower right corner of the second block and when pressed, it...

View Article

How to create a div using JavaScript?

I have the following <div> which I have created using HTML and CSS. I don't want these divs to be created when the page loads, instead I would like them to be created only when a JavaScript...

View Article

Image may be NSFW.
Clik here to view.

Uncaught ReferenceError: React is not defined

I am trying to make ReactJS work with rails using this tutorial. I am getting this error: Uncaught ReferenceError: React is not definedBut I can access the React object in browser consoleI also added...

View Article


Failed to execute removeChild on Node

Other stack answers such as this and this seem to be specialized cases and I believe my case is more generalized. I am doing this in my js:var markerDiv =...

View Article

Image may be NSFW.
Clik here to view.

Use js-object defined in cell above

So I am creating an object in a cell in a quarto-file like this:```{ojs}{{ const persons = { mike: { age: 32, height: 180, }, anna: { age: 32, height: 175, }, };}}```I then want to use it in another...

View Article

Image may be NSFW.
Clik here to view.

Node/express error when i run "npm run dev" to access the pages [closed]

structure of the projectthis is app.js/** * Bugema University Vocational Training School Electronic Records Management System * Main application entry point */// Import required modulesconst express =...

View Article


How to Export HTML to Word Document with React js

Hello I have HTML data in my React App and want to export this in word document and download at button click event. can any one help to make this one please. let element = (<p style={{fontSize:...

View Article


html5 video tag not working in android phonegap

I have created application in android phonegap.I want to play video using html5 video player. My code is:<!DOCTYPE html><html><head><title>Video.js | HTML5 Video...

View Article

How to Add Logo/Client Slider in Bootstrap Website

I am trying to add a logo/client slider to a website I am working on (the one linked here).<script src="https://code.jquery.com/jquery-2.2.0.min.js"...

View Article

Laravel Master Blade file keeps loading the page and doesn't load

I have written some PHP files and a Blade file to load the contents of the page. I have incorporated all the styles and JavaScript files to load the page using Master.blade.php located in the...

View Article

Pass Data from HTML Page to Controller Using Ajax in ASP.NET MVC

I have a web page with a map on it, the user clicks a button on their mobile device and it should then show them their position based on their device's geolocation. I have the code which gets the...

View Article


Image may be NSFW.
Clik here to view.

How to add styles in Ag-Grid FIlter Apply and Clear Button?

I am using ag-grid to add table in my application.Right now I am trying to add styles to ag-grid Filter buttons, like Apply, Clear.I added these like in column definition to display the...

View Article

How to count certain elements in array?

I have an array:[1, 2, 3, 5, 2, 8, 9, 2]I would like to know how many 2s are in the array.What is the most elegant way to do it in JavaScript without looping with for loop?

View Article


Auto Dial a phone number from web application on mobile browser [closed]

I want to create a link on my html page for a phone number, such that clicking on that number will start a phone-call.Using anchor tag with href="tel:{phone number}" we can create a phone-link, but in...

View Article

Image may be NSFW.
Clik here to view.

Detect Which Application (Web, Mobile or Touch Browser) is Loading Web Page?

If you look at the image, there are shared web pages between the 3 applications, Web, Mobile and Touch Browser. I need to report the web pages uniquely per application. So if web page A is loaded, it...

View Article


Unable to add an OAUTH provider in AWS Amplify Sandbox

I've been using Amplify since days now and I would like to implement custom OAUTH providers in my sandbox. Currently, I've set up LinkedIn and my sandbox start with the Cognito user pool (my LinkedIn...

View Article

How to make basic connections without this error?

howToSolveGeneral GuideCreate Project Directory inside terminalmkdir "Project name"cd "Project name"mkdir backendmkdir "subdirectory2"mkdir "subdirectory3"Useful...

View Article

Worker + OffscreenCanvas synchronization problems

With Javascript, I want to render heavy vector graphics. Upon zoom, the whole content should be re-rendered. To achieve it in a visually smooth way, I tried 3 solutions with Web Workers:Two UI canvases...

View Article

How to create a Symfony controller for categories and products?

#[Route('/category', name: 'student_category')] public function category(EntityManagerInterface $entityManager): Response { $category = $entityManager->getRepository(Category::class)->findAll();...

View Article


What does empty parentheses in the arrow function mean? [duplicate]

<p><button>Click me</button></p><p>No handler here.</p><script> let para = document.querySelector("p"); let button = document.querySelector("Button");...

View Article


Emberjs - component using parent template after upgrading to ember 5.12 from...

I recently updated my app from ember 3.16 to ember 5.12 and have started seeing a weird issue.My component has started using template from the parent component is it extending.I am using co-located...

View Article

TypeError: (0 , _reactDom.render) is not a function

I'm new to React, so I started with the official tutorial, a tic-tac-toe game. I made some modifications to it, including adding a timestamp to the screen. Now I want to add tests.I created a file...

View Article

Get bounding client rectangle without borders

I made a function that transforms mouse coordinates to canvas pixel coordinates:/* Returns pixel coordinates according to the pixel that's under the mouse...

View Article


Metadata tags in Nextjs not recognized in google search

I'm working on a project built with Next.js and JavaScript. I tried to follow the Next.js documentation provided here (Optimizing: Metadata), which states that by declaring constants with metadata...

View Article

How do I update a dependency of a dev dependency?

My project has a dev dependency "@testing-library/react": "16.3.0",And Dependabot has flagged that the project has a security vulnerability and should bump @babel/runtime from 7.26.0 to 7.26.10My...

View Article

MouseMove event unpredicted behaviour when dragging cards

Hi I'm trying to imitate swiper.js effect, the drag effect where you can drag a cardand on dragging it will rotate and move according to the mouse movementbut I have a problem with my implementation...

View Article

Error "sh: node-gyp-build: command not found"

npm install is failing with the below message. I tried deleting the node_modules folder and installing it again, but it didn't work:15104 error command sh -c node-gyp-build15105 error sh:...

View Article



Image may be NSFW.
Clik here to view.

Discord bot responds multiple times for one event

I want my bot to respond once to a command such as .on. However, it responds multiple times per input:The code is:client.on('message', message =>{ if(message.content === '.on'){...

View Article


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>