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], etc.

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

Move Jquery based logic to vue js way

I woul like to ask you for advice. I have this kind of code in jquery: $('.selector').mousemove(function (e) { $position = Math.round(e.pageX / $(window).width() * 100000) / 1000; $('....
0
votes
0answers
6 views

How build combinations with maximum sum, that contains only from one digit per row and their total prices must be less then 15

How build combinations with maximum sum along the column, that contains only from one digit per row and their total prices must be less then 15 I need to find maximum sum along the column, each column ...
0
votes
0answers
4 views

Password Change while we enter incorrect otp

I am stuck with problem ,in reset password when I insert incorrect OTP password has been changed. but I want when I insert wrong OTP then password should not change. Don't know where i am wrong please ...
0
votes
0answers
5 views

Detect external anchor tag click event in vue js

I am getting html content from the service and render it in vue frontend. That html content having anchor tags which are having links to pages. There I need to detect the click event of the anchor tag....
-1
votes
0answers
21 views

JavaScript how to add to an array with each request object received

I have declared an empty array : var RequestList = new Array(); Now i want to parse the xml file for each request and add the value from the xml parsed element to the empty array: var e2 = doc.select(...
0
votes
0answers
5 views

JWT generate token with algorithm ES256

I am trying to generate an accessToken with algorithm ES256 and I use the following code: var privatekey = fs.readFileSync('./cert/private.pem', { encoding: 'utf8' }) const accessToken = jwt.sign( ...
0
votes
1answer
16 views

Mapping array<number> into Promise array issue

My goal is to generate an array of Promises dynamically (by using Array.map()), and execute them at a posterior time. export const ExecuteReader = async () => { let strAll = [1, 2].map((num) =&...
0
votes
0answers
5 views

Add type def to data object - Vue

Below is a simple Vue single file component that I Have created and I want to add type definition to its data object, How can I add type info without using typescript ? <template> <h2> {...
-4
votes
0answers
23 views

I have to to format my array in typescript [closed]

My Arry let arr=[["9430","47930397"],["1086","9281928"],["704","8364086"],["243","5566049"],["292","...
0
votes
0answers
11 views

Unable to add values to array state React

I recently posted a question with regards to sending and receiving data via a websocket. In the interest of not duplicating most of the work, the original question is found here: Socket.io emitting ...
0
votes
0answers
11 views

How to Route to specific pages based on id?

In one of my React project, I have two components PhotoComp and VideoComp. I call both components based on following API -> /content/list/abc123ghi for VideoComp and /content/list/pqr456yui for ...
0
votes
0answers
8 views

how can I update/moving my canvasjs chart without refreshing page in php

Here is my whole code of PHP and Canvasjs chart code. Actually, I'm done creating the chart and it is successfully shown, thus I want to make it moving without refreshing the page because the data ...
0
votes
0answers
15 views

Auto-scroll to active class on horizontal scrolling nav

I'm creating a horizontally scrolling top nav for an ordering system. I want it to behave the way Deliveroo does for example, where the fixed top menu scrolls horizontally to the current active nav ...
0
votes
0answers
15 views

how to make dynamic file upload filed based on dropdown numeric value

how to make dynamic file upload filed based on dropdown numeric like when we select in dropdown no 1 then one file upload is show or we can select in dropdown no 2 then two field is show like that $(...
0
votes
0answers
22 views

No elements found in a HTML Document

I've made a quite simple scraper for personal purposes (getting new tasks opened on ServiceNow without having to constantly look myself) but I can't make it work correctly because GetElementsByTagName ...
0
votes
1answer
14 views

Make one column of an HTML table from array a clickable URL

I am generating an HTML data table using Google App Script and am trying to get the URL result to be clickable. Where should I be adding this? Should it be another function? function createTable(...
0
votes
0answers
4 views

How can i translate html text that in javascript using WPML

The issues are: i want to translate words that are in javascript .i am using WPML plugin in wordpress. text within HTML tags are not showing in WPML strings let html = `<div attrib class="...
0
votes
0answers
20 views

When using await for asynchronus function, returns a reserved keyword error

I am using AsyncStorage and I want to save the value of the async storage into a variable. let foo = await AsyncStorage.getItem(bar); This gives me Unexpected reserved word 'await' Why is that? ...
-4
votes
0answers
13 views
-1
votes
1answer
28 views

How can you console.log tab?

I would am trying to implement some functionality of the tab key. Is is possible to get it's current value/position or whatever really.
0
votes
0answers
17 views

Pass JavaScript array to PHP

I am creating Web application in which I have two different list. I have convert list into array and that array I want to pass from JavaScript to PHP for further analysis. This is an Example which is ...
0
votes
0answers
18 views

jquery ajax not defined

So I have an issue where I have an app.blade.php which acts as a master template. And a child template called show.blade.php. app.blade.php: <!doctype html> <html lang="{{ str_replace('_'...
0
votes
0answers
21 views

Why does my div tag not go up when i change the CSS top attribute using DOM?

This is a bit like a follow-up question to my previous one. I thought I had solved it but the div tag (the enemy) doesn't go up when the variable "i" is even. Here is the code: class ...
0
votes
0answers
4 views

Failed to execute 'createMediaKeys' on 'MediaKeySystemAccess': EME use is not allowed on unique origins

I'm trying to use VideoJS to play DRM protected content. I'm using videojs-contrib-eme to handle the DRM part. I try the example on the GitHub page https://github.com/videojs/videojs-contrib-eme/tree/...
0
votes
0answers
13 views

React add class based on focus in other component

Im making an app that generates a text based on input fields. I have a container with 2 components, 1 component has the inputs, the other the text. When typing in an textfield, or changing the ...
0
votes
0answers
7 views

Creating button that axios.post something from input

i have to create a button that will do a axios.post request, if something is in input. Im stuck, my HTML: <!DOCTYPE html> <html lang="pl-PL"> <head> <meta charset=&...
1
vote
0answers
6 views

How can the user of my website dynamically choose between audio tracks of a video?

What I want My goal is to allow the users of my website to switch the active audio track of a specific video. Sadly I have no background in web development, and have not been able to figure out how to ...
-2
votes
0answers
17 views

returning array value in backticks [closed]

I have an array with a few values which is let label = ['Webflow', 'Wordpress', 'Wix']. Below this I have some code on backticks and I want to pass this value inside the backticks Keep in mind that ...
0
votes
0answers
9 views

create dynamic json key value pairs [duplicate]

I am building an dynamic json key value pairs, I am getting const arrayRows = rows[0]; arrayRows.forEach(element => { const schema = { "element": { // how do i get the element ...
0
votes
0answers
14 views

How can I display the text html code as unformatted text using a JavaScript function?

I'm using basic Javascript and HTML and this is the output that I'm trying to achieve: 1 2 3 innerHTML = 1 textContent= 1 innerHTML = <p> 2 </p> textContent= 2 innerHTML = 3 textContent= ...
0
votes
0answers
7 views

How can i allow text selection in a div that contains @click event in Vuejs?

when i try to select a text in a div that contains @click event, the selection can't be maintained, it disapears after clicking on the text how can i enable text selection in that case, so that i can ...
0
votes
0answers
4 views

How to make a simple downloader client using chunk buffering

I want to make a simple downloader that downloads parts on the server in browser and after they finish it join them together and save it through browser like what Mega.nz does So like we have 5 chunks ...
0
votes
0answers
3 views

OPX2: planisware: how to show with a opx2 syntax the number of entered characters

I was trying to show and limit in the text input field the entered max characters to 50. When It reached and user clicked apply I was managed to show a message, but after that user still was able to ...
0
votes
2answers
40 views

How to sort JavaScript array items by same position in second array?

I have two types of arrays, With the same number of items, in one are a plane array in the second I have their new indexes. First array : let arrayOfPersons = [ { myName: "Person 0" }, ...
-1
votes
0answers
16 views

PHP:Dynamically sorting table

Hi I am having a problem with sorting data. The very essence of the problem: loading a table with e-mails, I should have sorting buttons for each domain, for example (gmal, yahoo, inbox), but then the ...
0
votes
1answer
13 views

Bootstrap 4 form validation: Add same rule for password comparison

I use Bootstrap 4 / JS form validation (https://getbootstrap.com/docs/4.0/components/forms/#custom-styles) which works as intended. I am trying to add the same formatting and submission rules for a ...
0
votes
0answers
12 views

Fade in/out loop speeds up after first cycle

So, I have 4 different arrays of elements that I would like to place in an infinite fadein/fadeout loop (in such a way that I first see the elements of the first array, then they fade out and the ...
2
votes
1answer
23 views

onBlur and onChange Influence each other

const SimpleChoiceItem = (props: Props) => { const { content, isSelected, onChange, onMove, onDelete, is_default } = props; const [isEdit, setIsEdit] = React.useState<boolean>(false); ...
0
votes
0answers
11 views

DiscordJS, MongoDB find string in object

Heyyo!! I need some help. I am currently working on a task system in my discordbot. I like to mention: I am working with MongoDB for like 6-7 days. So I am a newcomer with databases. Now, Im going to ...
1
vote
0answers
21 views

Random mouse movement between 2 coordinates?

Me and my friend made a game and we are trying to create a bot for it. Its repeating the same action over and over again. But the mouse always follows the same path from point A to point B. Is there a ...
-4
votes
0answers
17 views

How do I make a web app such as https://cycle-ergo.com/? [closed]

I'm looking to make a web app centred around human ergonomics. The web app should allow users to choose a human model alongside a desk table (of various sizes) to see if the design is ergonomically ...
0
votes
1answer
33 views

Array returning 1 after pushing an item to the array in javascript

I am pushing a string to a string. But, after returning the array surprisingly I am getting the "1". I inspected this carefully, array is creating but before returning it is returning just 1....
0
votes
0answers
21 views

Get the value from url using react js

I have the next situation in my react js application. I have 3 pages, one of the page is Login page: import "./styles.css"; import { Redirect, useLocation, useHistory } from 'react-router-dom'; ...
0
votes
0answers
6 views

QZ-tray center align

JavaScript Code for Printing Barcode function printBarCode(name, age, agenUnit, gender, visitID) { qz.websocket.connect().then(function() { return qz.printers.find("BARCODE PRINTER&...
1
vote
1answer
13 views

How to get CSV headers and Rows Separately Typescript

I have a csv file, after parsing it with fast-csv, I get the headers and rows placed in the right order and stored in a folder. Now, I want to get the headers and rows stored separately, for example, ...
0
votes
0answers
14 views

How to disabled one field for valid reactive forms?

I have one mistake why my form is not valid. The reason for this is this json phone: { areaCode: null countryCode: 1 e164: "+11234567" extension: "" nationalNumber: 1234567 ...
-1
votes
0answers
34 views

React localhost:3000, webpage not available error

I was running a react app on windows 10. when I run 'npm start', and in console there is > my-app@0.1.0 start C:\Users\Toshiba\Desktop\Projects\REAT sample\my-app > node scripts/start.js i 「wds」...
1
vote
1answer
15 views

Authentication Failed while making REST API call to GET container details in AZURE STORAGE BLOB

I am trying to obtain Container details in Azure Storage Blob. But it throws Auth Failed, I think there might be problems with my resource string formulation. Here's the code: const CryptoJS = require(...
0
votes
0answers
9 views

FIREBASE getting document data

I'm making an app and trying to get product data by it's id inside a modal in ionic 4. I'm using typescript to do it but without luck. Because de calls to firebase are asynchronous i cannot get the ...
-1
votes
1answer
16 views

Is it possible to use this code (or convert it) with a different jQuery version?

In my project im jusing jQuery 3.5.1 and this code doesn't work with that version. My question is, if it is possible to convert this code to be usable with jQuery 3.5.1 This is probably a stupid ...

1
2 3 4 5
43558