Questions tagged [javascript]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
I have been working on a chat application where users can enter a room and message each other. Everything is working fine, but I’ve noticed that when sending a message containing HTTP:// & HTTP:// ...
I have a nodejs process with 4 different websockets, each pushing thousand events each second.
For each event I'm calling an async function which elaborate it.
Does nodejs execute this function in ...
I am trying to figure out how do I stack each of the images above the text? The way it is currently it is it produces each image on the same line as the associated text so I am trying to do the ...
asked 8 mins ago
bain
26144 silver badges1414 bronze badges
<img height="500" width="500">
<script>
imgDimension = document.getElemetsByTagName('img')[0].?
imgSection = ?.[?];
imageSection.imgSection = function ?(){}
...
Wondering if anyone can help me out in figuring a way to print out in one text box the results from a script I made to pull data from other text boxes. So far it's all worked out but on the last stage ...
asked 9 mins ago
Dave
1,74411 gold badge88 silver badges1111 bronze badges
I have 2 lists (conversion from kilometers to miles etc.). When I'm trying to use input value to calculate (so "X * 1.609" for kilometers to miles) I have an error NaN.
const inputPlace =...
I want to create a RegExp validation in javascript for string which can have 5 parts of alphanumeric seperated by only 4 dash.
ed87aceb-cc6f-4535-be4e-867ac15310ab
Invalid entries are
More than or ...
I'm workin' on a website that has two different menus and both use Bootstrap. they have to work opposite of each other, I wanna write the code when clicking on one of the menus to expand, the other ...
In Javascript, I need to "fix" a string, supposed to be JSON valid but may not be. The string has the following format (the unknown part is marked with "<INVALID_CHARS>"):
[
...
add new button doesn't work if any existing row is deleted before adding
delete button doesn't work for newly added rows
checkbox on the top should select/remove all rows
age column is an integer, ...
I'm trying to include a new font face in my React application. This is built using Webpack.
I've followed the webpack documentation of font bundling, https://webpack.js.org/guides/asset-management/#...
Say there is website X which hosts a video on it's page. How could I possibly retransmit that video onto another player on another website?
Phrased differently - how can I capture the original video ...
I'm trying to insert a big array of data in MySQL database with node.js.
My code works correctly with small array about 300 elements, but when I insert an array with 1M elements I have the following ...
I have this javascript code. It is a group of drop down lists and two buttons (Add button and Remove button).
This image is the initial display.
When I click the "Add Item" button, I want ...
I have an audio element in my html to which im feeding an mp3 file for every item in an array, that works fine. What i want to happen is that it loads its metadata and reads its duration, then ...
I'm working on a small canvas game engine and rewriting a part of it that loads images.
export default class Loader {
images = {};
async init() {
await this.loadImage("grid&...
Currently, I have a dropdown menu that looks like the image below. It is using the <Dropdown> which is being imported. However, when I change the <Dropdown> to <ul> instead I am ...
I cant find the error on my code but I am getting an uncaught TypeError message everytime I run it. It says uncaught typeError: cannot read properties of undefined reading 'readyState' at ...
As you can see I am trying to getting 12.0. But instead i am getting 12 how can i add a 0 and make this number to a float please help
*JavaScript
let a = 6.0;
let b = 6.0;
console.log(a);
I want to make a Class that will fetch my products and stringify them but console says that Products is already defined. Can you help me? Thanks a lot. That's my code:
//cart
var cart = [];
// ...
Is there a way to detect whether a Japanese (or other language) input method editor is active when a user is typing into an input box in Javascript? I have an input box which responds to the enter key ...
I am trying to input an array of strings to my program using readline module.
an example:
const readline = require('readline');
const r = readline.createInterface({
input: process.stdin,
output: ...
I need a Regex expression for words with
at least 6 characters
only letters and digits
at least one digit
at least one letter
I have been testing this one
/^((?=.*\d)(?=.*[a-zA-Z]))\w{6,}$/
but ...
asked 36 mins ago
Raul
1,86222 silver badges1818 bronze badges
I am currently learning JavaScript and I thought that I understood functions. Apparently not. I thought that, in the following code, first argument of apply() call, which is this, would evaluate to ...
asked 38 mins ago
AlexBor
13911 silver badge1111 bronze badges
Good afternoon,
is there any way to receive information through bluetooth and send it to the backend? I use React-Native
I'm building an application that allows editing text files using Electron and Typescript.
The application has two main requirements:
Supports AutoSave
When an external app modifies the text file, the ...
I'm trying to create a GIF/PNG generator which would combine images from different arrays and create a new array that would be converted into zip file with PNG/GIF images.
I currently hit the wall ...
I have a lazy load component where I have 3 parameters:
children: is a component to pass to the Suspense component.
height: is the height for the LazyLoad component load icon.
width: is the width for ...
asked 43 mins ago
Jose Lora
99888 silver badges1414 bronze badges
I started learning about reactive programming, I have learned the paradigm and have gotten familiar with RxJS. I created a simple search engine bar using RxJS and vanilla JS with lodash in order to ...
asked 47 mins ago
Spongi
38411 gold badge66 silver badges1616 bronze badges
I'm using BlockEmbed from
var BlockEmbed = Quill.import('blots/block/embed');
And my Image insertion code looks like this
class Youtube extends BlockEmbed {
static create(value) {
var node = ...
I'm trying to build an app that has a main component which imports a tab component which based on the selected tab, loads a component or the other one.
The problem appears because in that component, ...
asked 48 mins ago
Leo Messi
3,00622 gold badges2727 silver badges6464 bronze badges
<a href="{% url 'main:projectdata' proname=pro.projectname n=state %}"></a>
<script>
var state = 'Done';
</script>
how to pass javascript variable state into ...
I want to implement a private video chat room software onto my website. Like Google Meet without the bells and whistles (just video calling with a shareable private link).
I found an open source ...
I´m trying to write the necessary statements to print the four verses of the Programmer's Lament but in reverse order. I´m trying to learn more about code and doing some exercises, the verses are ones ...
I am trying to implement large file upload with resumable.js and laravel-chunk-upload. Everything is working fine, that is I am able to upload large files properly but the problem is, if anything ...
I'm trying to spy on a function so I can check if it's being called inside a try/catch, but I can't do that check. I believe the problem is in the spy assembly, as it can connect to the database, ...
I used @John Strood's answer from here to build my current script. The below code is close to my need, I now just need to append text to the results.
For example, appending site:imdb.com/title ...
I have a rich text editor built using draftjs. I implemented the functions for changing the font size, font family, and color of the text in the editor. I also implemented the functionality of adding ...
I was wondering, is it ever possible to run a JQuery code on the next page (lets say Page 2) that is executed on another page before (lets say Page 1)?
So lets say this block was executed on Page 1
...
asked 1 hour ago
GLHF
3,57388 gold badges3333 silver badges7777 bronze badges
I would like to know how (and if this is possible) to pack arrays in JavaScript like in C++, because I would like to micro-optimise my code by packing an array. In C++ it looks like this:
#pragma ...
I have a React/TypeScript GraphQL/Apollo app that connects with an API and retreives a list of products and displays them on the page. The app starts and works fine. However, when I run a test (Jest + ...
I'm building a map in React with GoogleMap Api and now I want to cutom my fullWidthControl.
there is function that can I call instead the conrol?
(Like the setZoom..)
there is way to design the ...
EventListener not working in mobile. this script is working properly in PC but it's not working in mobile phone I have try onclick too then or other function but don't know why none of them working in ...
I am using 2 custom buttons and using JavaScript to click the audio play and pause.
I am using the below code for that:
<img class="head-iconn" src="img/audio.png" onClick="...
asked 1 hour ago
Jituu
10555 bronze badges
I have a link similar to https://app.ticketmaster.com/discovery/v2/events?apikey=xxxxxx&keyword=Sarah%20Jarosz&latlong=xx.xxxxx,-xxx.xxxx&radius=15&unit=miles&locale=* that is ...
I used event bus to pass values in real time.
However, although the selectPosts method operates asynchronously, I have heard that it is not always good to adjust the variable value using the event bus ...
I am looking to capture partial keyboard runs in strings (in Javascript); specifically the length of the run when three or more characters.
While I can do this if I know the starting letter – for ...
Every time I try to pass the animation variable to the EJS file in app.js I am met with the following error:
ReferenceError: NodeList is not defined
at toArray (C:\Users\18317\Documents\Web ...
So i have an MVC app, i want to clone the div with the tag class="item_details" but my problem is that when i clone 1 time everything is good, then i clone a second time but it will clone ...
I am just trying to implement my Roles Decorator in Nestjs. So far it went pretty well, until I wanted to compare the user of the payload data from the jwt-token to the required role. I can't explain ...