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], [jquery],[json], and [html].

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

not overlap div generator javascript

I'm trying to make a div generator that create objects in absolute position without allowing overlapping! This system must reconize if outher objects have already exist when they are generated ...
0
votes
0answers
8 views

Get value of object inside an array inside an object

I have a fundamental programming question. How do I pull the value of an object that has an array of object inside. For instance, responses_languages":[{"response":"the_value",...
0
votes
2answers
11 views

I don't know why im getting this: Uncaught TypeError: Cannot set property 'value' of null

i can't get why this code isn't right. everything seems good to me, but i keep getting the same error. here's my html: <form class="numeros" > <div class="...
1
vote
0answers
4 views

Make <Style> block !important using javascript?

I am trying to make a chrome extension that overrides the style used by a webpage of my choice. I have already figured out how to change the style using javascript, though when the page loads, the a ...
0
votes
0answers
6 views

Dynamically creating looping columns horizontal in HTML table from json array

I wanted to achieve similar result as shown in below image: [the similar result] https://i.stack.imgur.com/3Afft.png Question: Looking for Jquery or javascript solution to create dynamically looping ...
0
votes
0answers
5 views

Trying to verify a token in node js

After a user signs up i send them an email with a link containing a token and their email address. When they click that link im trying to verify the token by getting the token object and email value ...
0
votes
0answers
10 views

How to remove digits from string. based on the length and remove other letters with it

const item = "Dell Model 23506A Laptop M2"; const item2 = item.replace(/\d{2,}/g, ""); The above code will remove any words with "more than 2 digits found in a row, but will ...
0
votes
0answers
7 views

How can I figure out the behavior of call and bind on a javascript built in function

I was trying to understand this code. Array(8).fill(0).map(Number.call, Number). The problem is that the behavior of this is very hard to understand because there is no way to see the implementation ...
0
votes
0answers
8 views

How to access data from other components in React

App.js import React from 'react'; import LoginGuestButton, {getGuestValue} from './components/LoginGuestButton'; function App() { return ( //If User is not a guest user, then display the login ...
0
votes
2answers
11 views

Puppeteer.js : get href attribute of link with given text

is there a way in puppeteer to get the href attribute of an anchor element with text "See more". I want to grab the href attribute of an element like this: <a href="/this-is-what-i-...
0
votes
0answers
10 views

how do i reuse a react component but with different colours?

Hi I am very new to react and coding so please baby me in your explanations. I have created a component in react named Header1. I have used dynamic text using props so I can change the wording for ...
0
votes
0answers
9 views

Is /src and /dist only for static assets and public files?

If I have an Express App, would /src be only for pre-processed client side assets like CSS, JS, and images, and /dist is for minified and post processed versions of these files? Express server files, ...
1
vote
0answers
8 views

Autofill using javascript got remove when tap on text input, how to solve this issue?

Hello Javascript programmers! I don't know about javascript but I write a code to autofill form in this https://www.adidas.com/us/delivery site. that successfully fill the form. But when I tap on ...
0
votes
0answers
6 views

Smartsupp Live Chat does not appear on my website

I am using wordpress website and have added code in head section but still chat box is not appearing on website. I am using Smartsupp live chat. When checked i can see script but its not calling the ...
0
votes
1answer
15 views

How do I trigger a jQuery code while using the jQuery validation library?

I am using jQuery validation library to validate both password inputs to have the same value. My code is written below. $(".woocommerce-ResetPassword").validate({ onfocusout: false, ...
0
votes
0answers
7 views

Is it less secure to return CSRF token in response body vs response cookie (header)?

Is it any less secure to return a csrf-token via res.json(), than returning via res.cookie()? My project configuration is set as follows: Domains: front-end: "https://front.domainA.com" /...
0
votes
0answers
7 views

Translate email angular

How to translate email with two languages from the frontend to the backend when you click on the button fr or en the translation will be done in both at the same time with the same language !!!
0
votes
0answers
6 views

Vue component interaction with Vanilla JS

I work with RPA, and in order to emulate human behavior to bypass a captcha, I need to interact with a Vue component in a specific website. I will inject the Vanilla JS code, so I was wondering if ...
0
votes
0answers
5 views

How to query json array for a mapbox map?

I'm making a choropleth map with mapbox that changes over time. I'm following mapbox's example, but I need to show new data values (rather than filter) every year. I thought this would be as simple as ...
0
votes
0answers
7 views

How to get a record with a highest attribute in RESTful api?

Can anybody tell me how to get a record with a highest attribute in RESTful api? What I currently write is like GET ../api/products?limit=1&sort_by=count. But I'm not sure whether it's correct. ...
0
votes
0answers
5 views

Javascript:Using Vue/React for a code test related to API get/post and serializing data?

I'm doing a timed code test tomorrow where all I know is that it will be making GET and POST requests and handling the data. I was told I could use any language and could use any library. I was ...
-1
votes
0answers
14 views

How to filter out duplicates in saved search?

Hi I am in need of a saved search that does not return duplicate Submarket Labels. Reason is because this search returns like 24000 entries, but there are only like 10 submarket labels. I just need to ...
0
votes
1answer
21 views

Javascript, cut string to under length, but only at specific spots

Let's say I have a long string, each part following this format: <@some numbers> And I also have a character limit. I want it to cut the string only at the spaces but have it under the character ...
0
votes
1answer
7 views

Parsing JSON object with AsyncStorage

I am basically trying to write and read a simple object. Writing: AsyncStorage.setItem('@Test', JSON.stringify(newStudent)) Reading: console.log(JSON.parse(AsyncStorage.getItem('@Test'))) But im ...
1
vote
0answers
16 views

Open a modal over any screen in a tab bottom navigation flow in React Native

I'm facing a problem with react native tabBottom navigation. I have a TabButton customized components that on click renders the modal, but i can't seem to find a way of render that specific modal over ...
0
votes
0answers
13 views

Why the value for r is negative from d3.hierarchy in circle packing in d3.js?

I'm using https://observablehq.com/@d3/zoomable-circle-packing as an example to try d3 and circle packing in angular. I have the data which seems to be hierarchical and I'm following along the code ...
1
vote
0answers
12 views

JavaScript - Dynamic RegExp for Duplicate Characters

I'm very new to programming, and I'm trying to solve an exercise where you encode a string (in this case, a single word) based on whether or not the constituent characters occur twice or more. ...
0
votes
2answers
31 views

Get from one number to another number

Given a number, say 1.2, is there a simple way in JavaScript, to get to -1.5 in steps of .1. Or from say -50.3 to 12.3. I'm trying to figure out if there is an easier way of doing this then writing a ...
1
vote
1answer
14 views

Make button is disabled if space is typed in textarea

I'm making a system with JS with a form so that unless the user types something on a textbox, the submit button is enabled, else it will be disabled, but here's the problem: When the user types a ...
1
vote
0answers
9 views

Scroll bar for chat system is is auto scrolling down all the time

I had created a simple chat system using jQuery and ajax, I want the scroll bar to be in the bottom of div in two occasion that is : _first time loading page. _New messages has arrived. the problem is ...
0
votes
1answer
8 views

Using Parents() on an element which gets reinserted on click

I have created a dropdown functionality using Jquery with one event listener that allows me to close the dropdown when clicked anywhere outside the dropdown container and another event listener which ...
1
vote
2answers
33 views

Best way to replace an array with its contents from inside an object

I'm given the following JavaScript object: { name: [ { "firstName":"First ", "lastName":"Last" } ], age: 21 }...
0
votes
0answers
8 views

Problem with pixi.js to use DisplacementFilter

I try to do a fake 3D effect with a depthmap using pixi.js. Here my code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <...
0
votes
1answer
15 views

Create DataObject to hold different types of data as needed

So i recently went from Javascript to Java codebase for an automation framework, when it comes to data supplied to our page object methods we usually used an object in javascript shown as this: const ...
0
votes
1answer
16 views

How to return JSON data on successfull async ajax request in javascript

I am submitting a form using ajax, How can I pass successful data back to the submission page? I am submitting a transaction over the TRON network so the response is an array with the transaction ID ...
0
votes
0answers
8 views

How do i grey out some stats in Google GeoChart that are not part of my alerting

I am using Google visualization GeoChart to color code US states based on quantity network alerts by state. I get these alerts through Solarwinds Orion where i have a custom Attribute of all my nodes ...
0
votes
1answer
23 views

Beginner - I want the scroll bar to move down with JS

Following guys, I used the code: window.scrollBy (0, window.innerHeight) And yes, it scrolls down the instagram home page. However, when I go to my story, and see who viewed it, I want him to scroll ...
0
votes
0answers
11 views

Specify what to remove from npm package after installation

I am creating an npm library with create-react-library tool and I have some troubles with including assets(fonts) to lib. After installing my library via npm install it compiles bundle to dist folder ...
0
votes
0answers
10 views

How to capture a utm and pass its parameter to a new url?

I have a page with several buttons that lead to a shopping cart on an external page. What I would like to do is the following: Capture this user's utms when he arrives on this purchase page and after ...
0
votes
0answers
8 views

how to run function javascript when onload pageand the some time Check ID

i want to know if this function is correct i want to run function ParseJSON1; / ParseJSON2; when window.onload this my first day with javascript function langue() { var english = document....
-2
votes
1answer
21 views

injection sql dans ajax [closed]

Good evening. I recently developed a web application with AJAX framework. I would like to know if it is possible to do SQL Injection in a form with a similar authentication javscript function: $.ajax({...
-3
votes
2answers
31 views

Hide div if li id is blank

I need to hide the div if the li is blank <div> <ul> <li id=“item1”></li> <li></li> </ul> </div> $(document).ready(function () { $(‘#div’)....
0
votes
0answers
7 views

Can't submit Form action since it is hidden by overlay - I've tried Z-Index and Pointer-events:none; CSS/React

After layering on my css, my buttons in my react component are no longer clickable. I suspect that it's being hidden by the background/overlay. I've encompassed the buttons in a class called buttons-...
-3
votes
1answer
26 views

Cant even run code in browser because localhost refused to connect

Use Vscode for the first time. Use ctrl + f5 to run code. It opens up a chrome window and get hit with a This site can’t be reachedlocalhost refused to connect. Try: Checking the connection Checking ...
0
votes
1answer
16 views

JS | Why add () at the end of an immediately-invoked function expression?

So I decided to "re-learn" JavaScript since I forgot quite a bit. And I stumbled across the immediately-invoked function expression. I understood everything except the () at the end. Example:...
-4
votes
0answers
8 views

New to JavaScript: How to figure out what storefront API is being used?

I think the title says it all. Basically I want to figure out which storefront api a particular website is utilizing. In the end I wish to find the documentation to retrieve the full catalogue of all ...
-5
votes
0answers
19 views

Marcar checkbox de acordo com valores do banco de dados usando JavaScript [closed]

Criei uma janela modal para editar informações. Utilizei a o Bootstrap para isso. Dentro dessa janela modal, tenho 7 checkbox, cada um com um dia da semana. No banco de dados, tenho uma coluna chamada ...
0
votes
0answers
16 views

Get user data with Angular httpClient

I want to fetch user data, but I always get null. Here's my route: router.get('/user', (req,res)=>{ res.send(req.user); }) Don't want to go into the details, but on http://localhost:4000/auth/...
0
votes
0answers
6 views

Connecting to Crossbar server with JavaScript gives `Connection to the other side was lost in a non-clean fashion` error

I've been trying to make a simple WAMP RPC based application using Autobahn(JavaScript) and Crossbar. The script doesn't work in both secured and unsecured connections. Crossbar config.json:- { &...
0
votes
0answers
4 views

Error: write EPIPE at afterWriteDispatched while using AWS Lambda

I am following along 'AWS Lambda In Action' and am trying to write a Lambda function to create a thumbnail of the photo that I upload to an S3 bucket. Here is the source code for the given task: https:...

1
2 3 4 5
41783