Stack Overflow » JavaScript
1,281 FOLLOWERS
Stack Overflow is the largest, most trusted online community for developers to learn, share their programming knowledge, and build their careers. Visit and ask all your Java programming-related questions here and find quality solutions & suggestions.
Stack Overflow » JavaScript
49m ago
I am getting the data from mongodbd with success; However, when I send to html page returns the error "workData is not defined". I am not using the app.js page to render. I am using the '/api/time', router to render and save data to db. When I try to send the workData getting from mongoose in the r_time.js and render the data using res.render('pages/punch_log', {workData}), it returns the error "workData is not defined". How should I render this data?
app.js
//import base routes
const baseRoutes = require('./routes/base_routes')
const { time } = require('console')
app.use('/', baseRoutes)
app ..read more
Stack Overflow » JavaScript
49m ago
As Google Analytics has now updated to Google Analytics 4, I am wondering how do you configure a _gaq.push(). I am wanting to utilize an anti-adblock (BlockAdBlock.com) but still track it in Google Analytics.
On this website, under the Analytics Integration section it gives an example of
_gaq.push(['_trackEvent', 'BlockAdblock', 'Yes', undefined, undefined, true]);
However, all tutorials are outdated for the old Google Analytics. Wondering if someone could assist in helping me figure out how to set a _gaq.push ..read more
Stack Overflow » JavaScript
49m ago
I am reading the React new documentation here, it said:
Here, the context value is a JavaScript object with two properties, one of which is a function. Whenever MyApp re-renders (for example, on a route update), this will be a different object pointing at a different function, so React will also have to re-render all components deep in the tree that call useContext(AuthContext).
For what said "so React will also have to re-render all components deep in the tree that call useContext(AuthContext)", I wonder is that not so right. From what I tested, if a parent component call setState() method ..read more
Stack Overflow » JavaScript
49m ago
Is there a simple 'filter all other dropdowns according to the one that triggered the 'change' event?
My goal: Build an excel-style 'Autofilter' dropdown for each column in a table. Filter each column's dropdown options by those selected in the other columns.
The table has 3 columns: Category, Subcategory, Product.
I'm struggling to find a simple way to script 'Filter all other dropdowns by this dropdown', other than specifically mapping Column 1's filter conditions to Columns 2 and 3, and likewise mapping Column 2's filters to Columns 1 and 3 etc. This would have clear scaling issues.
The cur ..read more
Stack Overflow » JavaScript
49m ago
I am stuck on how to create/implement a button with this style/shape. Any guidance would be appreciated
Note: this is a generic HTML CSS component/button ..read more
Stack Overflow » JavaScript
49m ago
I am attempting to make a website to talk to Cyrus the Great. I have set up Gemini to respond to any input as if it's Cyrus the Great but when testing it I have encountered a unusual problem. I can get a response if the input is pretty short but the input "Hi there ruler of the great Persian empire Cyrus" gets a response but "What did your people eat" doesn't. I haven't found anything for this so I'm very confused. Here's the code segment for Gemini.
import { GoogleGenerativeAI } from "@google/generative-ai";
// Fetch your API_KEY
const API_KEY = 'AIzaSyDZkGbYLU7jqWsKpWj6B5JYhdHMECSKBDE ..read more
Stack Overflow » JavaScript
49m ago
I'm doing a web application in React that resembles a web conference app, so I require camera and microphone access.
When I request access for the camera and microphone, I do it with a single prompt, as encouraged in the Media Capture and Streams W3C Draft. So I get access to both devices and everything works fine.
The problem I have is the following - I have these three objects:
let both = await navigator.mediaDevices.getUserMedia({video: true, audio: true});
// Separate streams
let video = await navigator.mediaDevices.getUserMedia({video: true, audio: false});
let audio = await navigator.m ..read more
Stack Overflow » JavaScript
49m ago
I have one array of items and I want to display then in a unordered list. First I want to just show a few of these and after I press the button "Show More", the others items get displayed on browser.
I'm trying to pass the array to the template and using the for loop of Flask , display the itens (but not all of them) to browser. And using javascript DOM functions, displays the rest os elements. I dont know how to solve this or how to find the best way.
I tried to do it in some ways, but the best approach displayed just one item, not all of the others, the format of unordered list is vanished ..read more
Stack Overflow » JavaScript
49m ago
I don't know why react is easier than css3(cascading stylesheet) but Is there any way to convert Tailwind CSS from react to normal CSS? I tried to write it manually but takes lot of time but some of the property also not easy to understand ..read more
Stack Overflow » JavaScript
2h ago
I am having a problem with my form input not appearing under my table headings after submitting. Even after I have gone through the code a number of times. What can be the problem of my code?
Or do have any suggestions in writing the code correctly and easier?
When I enter the values and submit, the table still remains the same with no changes or alteration.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link href="style.css" >
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/boots ..read more