Dark mode beta

You’ve been asking for dark mode for years.
The dark mode beta is finally here.

Change your preferences any time.

Questions tagged [javascript]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). This tag is rarely used alone but is most often associated with the tags [node.js], [json], and [html].

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

How to convert blob to MP3 in ReactJS?

I am recording audio from microphone of the user with MediaRecorder and using Navigator.getUserMedia. getUserMedia({ audio: true }) .then(stream => { this.stream = stream; const mimeType ...
0
votes
0answers
7 views

Can I retrieve button click information from another html in an object tag?

I currently have an object type="text/html" in my GSP displaying a Jenkins Blue Ocean. I want to be able to track which one of my users clicked "proceed" or "abort", but because these buttons are part ...
0
votes
0answers
7 views

Why did the server responded with a status of 415 - API Post Method

I'm trying to create my own API using Spring Boot, which for now uses access to external data from an air quality API. I have a CityInfo entity: @Entity public class CityInfo{ @Id private ...
0
votes
0answers
4 views

Using Origin PlaceID and destination PlaceID to get distance

am doing a school project to pull out various Origin place IDs to a user defined destination PlaceID. I have leveraged on the Google Developer Platform Help to understand however am still having ...
0
votes
0answers
3 views

Search query tracking from iframe

On www.mypage.com i have an iframe with www.search.mypage.com. Both parent frame and iframe have a GTM container I have access to. When a search is made in the iframe, the iframe GTM container sends a ...
0
votes
0answers
9 views

react-table lost focus on filter?

I am making a table base on react-table v7 and react-window. I found other question on this site with the same question but almost they are using v6 - almost difference. Problem is the filter text ...
-1
votes
0answers
15 views

Why Object.values retains its parents' reference even if the object is cloned?

Say you have an object obj = { a : [1, 2] } and you create a clone of it objClone = Object.assign({}, obj) and when you modify Object.values(objClone)[0][1], then the parent obj is also modified. Can ...
0
votes
0answers
3 views

Using i18next to replace a variable with a ReactNode element

I have a translation json file with the following translation: "pageNotFound": { "description": "The page could not be found. Click {{link}} to return to the home page" }, The link variable I am ...
0
votes
0answers
11 views

Typescript generics for array

i need that generic of Array has been extended from my class. How to do it properly? export interface DeliveryMethod { readonly id: string; readonly company: string; readonly cost: number; ...
-1
votes
1answer
8 views

Automatically Show 0 as Blank On table

I have a Table On COVID 19 Live Update, Now I wat to Keep Blank Cells where the Value is 0 & Show + before Other Number, What to DO?
0
votes
0answers
8 views

V8 ArrayBuffer from int array?

I've seen Copy data into v8::ArrayBuffer which is able to create an array buffer based on data like the following: QByteArray data_buffer(file.readAll().data(), file.size()); v8::Handle<v8::...
-1
votes
0answers
12 views

How to use proxy on React? (without CRA)

I want to proxy my /api requests from this React app to 'localhost:3000'. My React app is running on 'localhost:8080'. I used setupProxy.js for another project using CRA but this project is not using ...
-1
votes
0answers
24 views

JavaScript Alert Not Displaying. addEventListener HTML Form

I am watching a inLearning course and attempting to follow along the code myself. However the code does not seem to be working in any browser. As I am brand new to coding I am not sure what is causing ...
0
votes
0answers
7 views

Submit Form Using AJAX `onKeyUp` In Each <tr> Row Of A Table In Vanilla JavaScript

I have a table full of rows that have <form> tag inside them and have <input> tags inside cells as shown in the below markup. <table style="width:100%"> <tr> <th>...
-1
votes
1answer
13 views

How to get identical object within array of object in javascript

I have data like this: let objData = [{ "product_client_id": 24, "product_type": "VIRTUAL" }, { "product_client_id": 24, "product_type": "VIRTUAL" }, { "product_client_id": 86, ...
0
votes
1answer
12 views

How to change the value of BehaviorSubject with if else condition using find, filter, map etc.. in angular

TS dataArr1 = [ { id: '1', name: 'Room1', spinning: true }, { id: '2', name: 'Room2', spinning: true }, { id: '3', ...
-1
votes
0answers
3 views

I want to create a toggling effect when an element is clicked [duplicate]

I would like to get some help adding a toggling effect to this code. My (if) statement functions well and the statements within it are executed perfectly. But when the (svideo_one) element is clicked ...
0
votes
0answers
8 views

Discord.js - show deleted message author and number of their deleted messages

I have a simple code prune message code. but I want to improve it const number = args[0] let messages = await message.channel.fetchMessages({ limit: number }); let message = await ...
0
votes
0answers
9 views

OpenId Connect library from Vue app to OpenId provider

I am trying to build a Single Page Application using vue(client) and Java Spring REST APIs(backend). I need to secure them using OpenId Connect. The OpenId provider is RapidIdentity. This provider ...
0
votes
4answers
19 views

User input name JavaScript output is equal to variable attached to each letter in the name

This is my very first JavaScript project. What I am trying to do is when user enters there name for example "Blake" It will output "Bravo Lima Alpha Kilo Echo". So whatever user inputs it outputs ...
0
votes
0answers
8 views

How to show data text filed of selected items in multi select drop down list in a textarea?

I have three multi-select drop-down lists on the selection of items from these lists I want to show the item data text filed in a textarea with comma separation like item1,item2,item3,etc. Currently ...
0
votes
0answers
32 views

Fetch returning undefined after parsing with json

I am writing a JavaScipt application and am attempting to fetch data from a certain URL but am getting an undefined value. The expected value after fetching and converting it to json should result in ...
0
votes
1answer
10 views

Object destructuring or optional chaining which is better code?

Given there are two ways to write the code, which way is better in terms of effective code?const { match: { params: { clientId = '' } } } = this.props;const clientId = this.props?.match?.params?....
0
votes
2answers
34 views

Reformatting array object JavaScript

Sorry if this has been asked already but I'm pretty sure I'm close to the answer, and would appreciate a little help. The problem is getting the data object inside an array. example data: [ {x:value,...
0
votes
1answer
13 views

Assign var from Javascript to Asp Text

I have below: <asp:Chart ID="Chart1" runat="server"> <Titles> <asp:Title Name="Title1" Text="" Alignment="TopCenter"> </asp:Title> <asp:Title Name="...
0
votes
0answers
5 views

Google Analytics API response in Javascript has an issue with the row data

Set up my code and I'm fetching results. I am use the nodejs googleanalytics library and authenticating fine await googleAnalytics.data.ga.get({ 'ids': `ga:${accountId}`, 'start-date'...
0
votes
0answers
6 views

Cannot read property 'demographics' of undefined in ArcGIS API

I have create a custom HTML page for Find Existing Location analysis following this link https://developers.arcgis.com/javascript/3/jsapi/findexistinglocations-amd.html#event-job-submit I am able to ...
0
votes
0answers
8 views

Firebase Database Ref Multiple Collections in one Javascript file

New to firebase and JS! I have multiple HTML files that deal with different courses a person can take and are all formatted in the same way and one javascript file that all the HTML files use. ...
0
votes
1answer
12 views

Express Node - Return Results on Find Mongoose to variable

I'm going to return type_item to Client-side, but i can't return Mongoose results to variable type_item[i].items, it return nothing... How to return results from getting mongoose data to type_item? ...
0
votes
0answers
10 views

only Leaf node should contains different background and other should have common background

I tried to use identifyChildNode() function to differentiate the children and parents,its not working and any other logic would be helpful parents and children keys both indicative of having children ...
0
votes
0answers
10 views

Use Blazor to play local audio file in browser

Disclaimer: I am familiar with web technologies but still a newbie. Scenario: I want user to choose an audio file from local file system. Then I wish to show a small audio control on the webpage to ...
0
votes
4answers
27 views

Use Try/Catch Ideally

I have two function, the controller and the service. Here is the service code. const getVersion = async (type) => { const version = await Version.findOne({ TYPE: type }, { _id: false, VERSION: ...
0
votes
1answer
16 views

Why can I not parse my config.json file in JavaScript using RequireJS?

I have no idea why I'm not able to parse this JSON file in JS using RequireJS. var settings = require('https://api.jsonbin.io/b/5e9535d3634f8d782606be53'); var parsed = JSON.parse(settings); ...
2
votes
1answer
30 views

Object is possibly 'undefined' after validation in TypeScript

Please see the following code. Do we have a convenient method to overcome this? interface IAnimal { type?: "animal" | "bird"; body?: { legs?: number; }; } // validate type and body.legs ...
0
votes
3answers
33 views

dynamic fetch function in react [duplicate]

I am trying to write a function that I can reuse to make different fetch requests in my react app. But I am getting unexpected null value and the order in which the function is executed is confusing ...
0
votes
0answers
29 views

$.get data prints the source code of the sender

I am trying to send get request to a URL on my server (IP filtered. for the sake of the example {{computer.id}} is 1) - sender $.ajax({ url: "http://192.168.1.181:5000/computers/{{computer....
0
votes
0answers
6 views

Puppeteer combining object variables

I am using puppeteer for web scraping. The code I currently have grabs the title of every product on the page and stores into an object variable. Here is the code I currently have. const puppeteer = ...
-1
votes
2answers
30 views

Page doesn't load when I set variable to 0 in Javascript

var randomNumber = Math.floor(Math.random() * 6); var attempts = 0 var maximum = 3 while (attempts < maximum){ document.getElementById("submit").onclick = function() {...
0
votes
1answer
17 views

How to remove the modal and backdrop without hurting second display

I have a modal wrote by $(document).on('click', '.generate-modal-button', App.proposals.elementClickHandler); function elementClickHandler(event) { event.preventDefault(); $('#state-modal')....
-3
votes
0answers
23 views

Should people do master JavaScript first before getting into JAVA..? [closed]

I learned HTML5, CSS3, (a bit of) JavaScript and jQuery for 5 months, and I have got my portfolio website: http://dauhn-kim.com/portfolio/ During the course, I got to have more interests in coding ...
0
votes
1answer
28 views

component is not rendered when getting data from localStorage in an event handler

In an event handler when getting data from localStorage and assigning this data to state variables, component is not re-rendered to reflect new values The logic is that to verify if localStorage ...
-2
votes
0answers
17 views

When using password_hash() on PHP server side what hashing function to use to match it on JavaScript client side?

What I want to achieve. Generate hashed password on PHP server side using password_hash() and store it in Data Base. Send a hashed user password from html/JavaScript page to PHP script. On PHP side ...
0
votes
0answers
10 views

Netlify Forms - Empty Submission - Vue (Gridsome)

I hate to do this (share the whole code), but I feel like I have no other choice. I have been banging my head against the wall for the past two days. It is one issue after another. Currently, I am ...
0
votes
0answers
10 views

bindPopup() to markers only when they are clicked on

The following html code creates several markers and popups for them. ... is just a replacement for long things which I've ommitted as they don't have significance in solving my problem. As there are ...
0
votes
1answer
22 views

how to set email and phone number as default in login React js

i have problem with my login page. where i should set default my email phone number and pass to my login page so if i use email : abc@gmail.com, phone number 08123456789 and pass 123 only can ...
0
votes
0answers
14 views

Angular 9 forChild module not getting loaded

In my Angular 9 application, I've created a separate admin routing module and calling it in app.module to initialize. But the routes for the components like login and signup are not getting called nor ...
1
vote
4answers
31 views

how to iterate a object array to get key and value in typescript

I have a object array and would like to get key and value by iterating though it, however I only get 0, 1 as index. anyone know why? const vairable = [{key1: "value1"}, {key2: "value2"}] Object.keys(...
0
votes
1answer
16 views

How to use multiple ref variables on same html element in react?

Here is the brief snippet of my functional component's render method(removed unnecessary code for brevity) return ( <Draggable draggableId={id} index={index}> {(provided, snapshot) =...
-1
votes
0answers
23 views

Why do we need async/await or nesting callback functions if it makes our asynchronous code become synchronous? [closed]

I am new to Node.js asynchronous programming. Question: If calling async / await or nesting callback functions will make your asynchronous code become synchronous, why do we use them in the first ...
0
votes
0answers
10 views

Combine Wscript Regex Replace with Regex Match

I'm using generic Stdin-Stdout "Example.bat doc1.txt /r /o doc2.txt" batch file and switches and want to include both a RegExp replace function with a RegExp match function using the same operator ...

1
2 3 4 5
39656