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
7 views

Reactjs momentjs countdown in days

What I trying to achieve is, making a countdown to target day from now. inside of componentDidMount() : nowT = moment(new Date()).format("X"); // => 1603551057 (2020-10-24) targetDay = ...
0
votes
0answers
7 views

Can not able to get form values in Vue.Js

I am working on a Vuejs form and trying to get the values from an array in which data is already stored. but when I check it in the console it says undefined in the below code first I am getting ...
-2
votes
0answers
9 views

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'includes'

I have a email|password checker and i try to input a proxy using a simple code, but every time I put this on the proxy: it always returns the error to me: UnhandledPromiseRejectionWarning: TypeError: ...
0
votes
0answers
9 views

Error “ReferenceError: pathsToModuleNameMapper is not defined” when trying to run jest

I'm trying to run jest in a javascript react.js project that is using webpack, babel, enzyme and jasmine (among other things) and I'm seeing the error: ReferenceError: pathsToModuleNameMapper is not ...
0
votes
0answers
6 views

I am making notes application using for input I am using tinymce and Firebase. The problem is I cannot retrieve data on tinymce textarea to edit

I am making notes application using for input I am using tinymce and for database I am using Firebase. I can save data to firebase but the problem is I cannot retrieve data on tinymce textarea to edit....
0
votes
0answers
10 views

Difficulty adding unique event listener to created <div> elements via a for loop

I'm working on a project to learn some JavaScript, the goal is to serve up emails dynamically in a single page web application. The HTML of the application has been created using the createElement JS ...
0
votes
1answer
17 views

array_push pushes to many items in my session array PHP

I'm creating a litle webshop for fun. Each time a user clicks on a cetrain button, the function addToChart() is called. In this function i push all the needed data into an array. Afterward I send this ...
-1
votes
0answers
5 views

500 Internal Server Error when using $.ajax - id return null

I want pass data from controller using $.ajax but when run and debug the code in asp.net mvc project, I get id is null and get 500 Internal Server Error in inspect console. can anyone help me plzz ? [!...
0
votes
1answer
22 views

how to properly handle GIT branch is ahead of 'origin/master' by X commits

P.S: Please note that i have read almost all other related questions about this but it still not working at all. I have the following issue on master branch: git status On branch master Your branch is ...
-2
votes
1answer
30 views

How to change the height of an element using Javascript?

I am trying to modify the height of a div element in a Javascript function. The height is initially set to 50px in the style section. Neither of the attempts shown below have any effect. I would ...
0
votes
0answers
15 views

React Native: How to dispatch redux action from Custom Drawer

I have to dispatch logoutUser() action from CustomDrawerContentComponent. How can I do that? I have a StackNavigator as well as Drawer Navigator in my app. Also there is a CustomDrawerComponent to ...
0
votes
0answers
19 views

How to create button with equal proportionate? [duplicate]

How can i make each button of equal width and height and display on same line. But according to the character it is size of button constructed. Is it possible to create each button with size equal ...
-1
votes
1answer
13 views

HTML - [Mobile] How to Make objects align horizontally [closed]

I am making a custom casting service for my Raspberry Pi. I have a temporary one, but I am redesigning it. I am using Now-UI for this, I have 3 buttons in a card and I want them to show up ...
0
votes
0answers
5 views

how to add button or checkbox on a marker that can select a row id in laravel php

i want to add button or a checkbox on marker and i want if checkbox or button on marker checked/onclick it should check a checkbox off his own row see image using this code i am showion info window ...
0
votes
1answer
15 views

is there a way to pass a variable to modal using a link

here is my link and the sample data value i want to pass "data-id" <a href="#edit_task" data-toggle="modal" data-id="WAH"><i class="fas fa-edit fa-...
0
votes
1answer
14 views

Why Does Status Snap?

I am working on a discord app and making the status change. I am working on getting it to have command and then a message. Below the command works but for some reason the "This is a test" ...
0
votes
0answers
9 views

How to use <source> tag in v-img Vuetify.js?

I'm trying to use webp img to instead jpg or png img. Some browsers may not support the webp img, so we use the html tag < source > to do like this, to make sure there is at least a jpg img. <...
0
votes
1answer
16 views

slideshow sequence with one button JS

I've looked at numerous similar posts, which most of them have a previous button, but I only need one button to loop back to the original photo once it cycles through. I tried adjusting my code ...
0
votes
1answer
22 views

Vue 3 setup reactive fetch with async json

I've installed Vue 3 and want to populate a reactive object with fetch from a JSON API. My component looks like below. I don't get any errors but I don't get any results either. <template> <...
0
votes
1answer
12 views

Get all unordered list elements and their text - puppeteer

I am trying to retrieve an unordered list along with all the elements within it. The <ul> has <li>'s of cities and I want to get those cities. const cityArray = []; await page.$eval( ...
0
votes
0answers
13 views

Send File in ExpressJS without a file being created

I'm creating an API wrapper, and I want to make a route that will download a file from the API. However, the API I'm making a wrapper for only allows me to grab the content of a file, not the entire ...
-2
votes
0answers
15 views

Display an image at cursor postition when mouse hovers over a link [closed]

I have a list of a few navigation links on my website. I want to display a small image from my website repository at the position of cursor, when the visitor hovers over the link. Is there a ...
0
votes
1answer
21 views

how to show persons dynamically in React function based components

I am usinig function component instead of class based components. so i wanted to show persons data dynamically while clicking the button const App = props =>{ const [showPersons, setShowPersons] ...
0
votes
0answers
10 views

How to handle fast incoming WebSocket messages on the Client

following problem. I am trying to process data that gets send to my client. I have about 100 open subscriptions and they all send different data to my client, pretty much at the same time but I need ...
0
votes
0answers
6 views

Trigger Page Redirection AS SOON as Div Gets to Certain Position

I have a range of x and y coordinate values. When my div is inside this range, it is redirected to another page. I want this to happen once the div has entered this range and has stopped moving (...
0
votes
0answers
10 views

How to keep all functions after webpack build?

Webpack checks the usage of functions and remove (as dead code) the "unused" functions. But if I'm using the function inside HTML, the same function will be removed if none scripts calls it. ...
0
votes
0answers
13 views

Mutaded array value doesn't update to global scope fast enough, what to do? [duplicate]

my problem is because of asynchronous execution, I think. Here is the case: I have two empty arrays on a global scale: let stocks2 = []; let c = []; Then I make an api request (stock prices) with a ...
0
votes
0answers
6 views

document.cookie expires not working properly in Safari

I have a script where I save login information (email/encrypted pwd) in cookies for about 10 years. It is working in Firefox but, in Safari (on MacOS) it is only saved for a few days. Here is the code ...
1
vote
1answer
14 views

React app fails to import react app packaged with webpack

I have a react application to which I import another react project called react-lex-plus. I manage both projects. When I build react-lex-plus, webpack is able to bundle my applicaiton. However, when I ...
0
votes
0answers
10 views

How to iterate through axios interceptors and check if an intercepted is already added

How can I iterate through axios interceptors and check for a particular interceptor? For example, i want to check if a particular interceptor is (already) added? I am aware of this code, but it is at ...
1
vote
2answers
22 views

Postman test to check if every item of response's body has id existing in an array

The task is to check if every item of response's body has id existing in an array. Let me show you an example: let json = [ { "name": "Ford", "id": "6" }, ...
2
votes
4answers
50 views

How to create variables that hold variables

I think this is a simple one, and it may even have been asked previously, but I don't know what keywords to use to do a search. I believe that variables are strings and can only be strings, so even ...
0
votes
1answer
10 views

Multiple html canvas element with random graphics on same page

Trying to create multiple canvas element on a single html page and then draw different graphics on each of them . But the issue is , the same graphics is drawn on all of them without any randomization ...
0
votes
0answers
8 views

How to use Vue 'component' when you only added Vue as a page add-on (<script>)?

I want to use a vue component called vue-timeago: import VueTimeago from 'vue-timeago' Vue.use(VueTimeago, { name: 'Timeago', // Component name, `Timeago` by default locale: undefined, // Default ...
0
votes
3answers
27 views

Hide passwords that are in the .js file

I have a js file that sends emails like this: Email.send ({ Host: "smtp.gmail.com", Username: "mymail", Password: "mypassword", ...
-4
votes
1answer
24 views

The application that we get using create-react-app can be called a node.js application?

I want to understand that whether we should call the ReactJS application that we get after using create-react-app a "NodeJS application" or not, because just like a NodeJS application, ...
-1
votes
0answers
7 views

Convert SVG to STL on Website via script / Extension / [closed]

I would like to convert SVG files to STL files on my Website. On my website i have a SVG drawer extension where user can draw images after that they are saved in their library. Now i want to convert ...
-1
votes
0answers
16 views

How to generate unique pc/device ID in ReactJS? [closed]

Developing a web apps using ReactJS. I need to ensure that no user can login to multiple device at the same time. To identify the device I need to to generate a unique device ID. I tried a lot of ...
2
votes
3answers
38 views

How does injected JavaScript work within '{ }'?

In JSX, When we want to add JavaScript between JSX we use '{}', which indicates injected JavaScript. I was wondering how does this work? How does '{}' treats as JavaScript? Is it different than '${}'? ...
0
votes
1answer
18 views

Map strings to a color selected from a predefined array (JavaScript)

I'm adding tags to my website for blog posts and I want those tags to have different background colors (picked from a predefined array of theme colors). I want them to have the same background color ...
0
votes
2answers
35 views

work with Promise.then.then… or async/await?

Which one is better? There is a design pattern of which one should I use (considering a react environment)? Let's use as example those following blocks of code: function exampleFunction(data) { ...
1
vote
1answer
11 views

Why does my ValidateForm seem to be skipping some functions?

Im trying to build a form using HTML and Javascript. I ran into an issue and I cannot wrap my head around it. Maybe it is something meaningless that I am not noticing. I am calling a ValidateForm ...
1
vote
1answer
27 views

How to make the search bar for articles work HTML/CSS

My search bar is not working for some reasons, i cannot figure it out. This is the code for search bar: <input id="searchbar" onkeyup="search_text()" type="text" ...
2
votes
2answers
22 views

How to replace every comma inside round brackets with regexp

I have a string: "a: a(1, 2, 3), b: b(1, 2)" Need to replace every , inside round brackets with a _. I expect to see: "a: a(1_ 2_ 3), b: b(1_ 2)" Now i use it but only first ...
0
votes
0answers
14 views

fullcalendar create event on click JS

Hello i would like to know how to create an event on click with Fullcalendar and javascript. Like on the demo with the "Selectable Dates" https://fullcalendar.io/ Im new in developpement ...
0
votes
0answers
7 views

Video resolution issue, with MediaStreamRecorder

I am using MediaStreamRecorder for recorderType in RecordRTC and passing combine video stream and audio stream. The recording does well but the video resolution is too low I have tried a couple of ...
0
votes
0answers
8 views

How to handle async function in SSR for react component?

How should I handle async and await for a React Component that will be used in server side? For client side, I would use it in useEffect, but useEffect won't run in server side. Where should I handle ...
-2
votes
0answers
9 views

Adding my navigation bar component to an existing project [closed]

I am working on a project to create a college website. My friend made a react-app for each of the respective pages and pushed it to our repo on github. When I pulled the code those codes did not work. ...
1
vote
3answers
53 views

How to separate css code blocks in javascript?

How to separate css code blocks in javascript? Following are some css in the serialised form: const css = "body { background-color: lightblue; } h1 { color: white; text-align: center; } p { font-...
0
votes
0answers
9 views

This function is supposed to post user's project type and claim type details to the Dynamics 365 CRM database but it is not working

This function is supposed to post user's project type and claim type details to the Dynamics 365 CRM database but it is not working. function DataSubmit() { debugger; $...

1
2 3 4 5
42169