Questions tagged [javascript]

For questions about programming in ECMAScript (JavaScript/JS) and its different dialects/implementations (except for ActionScript). Note that JavaScript is NOT Java. Include all tags that are relevant to your question: e.g., [node.js], [jQuery], [JSON], [ReactJS], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

javascript
Filter by
Sorted by
Tagged with
0 votes
1 answer
91 views

Append array of object in HTML on click next and previous button

I need to append object in two different div so I used array of object, each time click next button show the next object. The problem is that the next button did no work or make any action. var ...
Fatma El Arabi's user avatar
-1 votes
3 answers
47 views

Merge two array of objects and added a new Key & Value

I have 2 arrays based on the "Form_Name" key value to merge an array with added new key&value "isChecked". Array One arrayOne = [ {id: 11, Form_Name: "form name One", isChecked: true} {id: 11, ...
imjayabal's user avatar
  • 807
1 vote
2 answers
32 views

Delay triggers wrong element to click

I have an example where button named both exclusively triggers a click of two separate elements (first and second buttons). Under normal circumstances each of the element listeners is triggered ...
Biker John's user avatar
  • 2,681
0 votes
1 answer
2k views

How to disable future dates in bsdatePicker

I am using bsdatepicker in my angular project and i want to disable all future dates in that datePicker for the DOB selection import { Component } from '@angular/core'; @Component({ selector: '...
A.K.'s user avatar
  • 539
0 votes
3 answers
930 views

Ignore scrollbar on mousedown event

I'm trying to build a code which will exit a modal when user clicks outside of the modal. The problem is when i click on vertical scrollbar it triggers the event for some reason. Here's my code $(...
Areg's user avatar
  • 1,476
3 votes
0 answers
517 views

Can I display ID-matched embedded data from a contact list as a link in Qualtrics survey?

In my survey, I need to show several different links to a few respondents, were each respondent is assigned 20+ unique links. Essentially, I want to pipe the link into a survey question to ...
Annie Chen's user avatar
-1 votes
2 answers
336 views

javascript - Show symbol rather text in button

I'm using a button to open a menu but I liked that this one shows up the menu symbol instead of the 'Menu' text. As below: ☰ -> ☰ ✖ -> ✖ function toggleText(...
Sergio C's user avatar
  • 113
-2 votes
1 answer
44 views

Why less than operator is not giving the right answer? [duplicate]

I have two input fields and want to compare them using less than operator. If i insert value less than 10 in one field and greater than 10 in other field and use less operator between them its not ...
hammer's user avatar
  • 82
3 votes
2 answers
2k views

Vue JS dynamic components in routes. Handling loading and error

In my vue application, I am importing the components dynamically which are then being used in the routes. So when you go to a specific route, the component chunk will be fetched dynamically. ...
void's user avatar
  • 36.5k
0 votes
2 answers
85 views

Dynamically passed function parameter for JS through php, is showing error that undefined

I have passed a parameter for js function in onclick event through php, but on click it is saying in console that parameter is undefined. code in php <?php echo "<div style='background-image: ...
Shivam Shukla's user avatar
2 votes
1 answer
441 views

Async function: for-Loop object empty after await statement

tldr at the bottom: I don't really know how to explain my problem so I start with an example. I have this async function (in reactJS but I think this is a JS related issue). onUploadDrop = async (e,...
Tim Gerhard's user avatar
  • 3,567
-1 votes
1 answer
1k views

set option label of selected value in React

Using React I want to set a defaulvalue for my select and diplay the label in the options. This is what I've built so far : <Select showSearch style = {{ width: '100%' }} ...
Ahmed's user avatar
  • 107
7 votes
4 answers
6k views

rxjs observable.pipe(take(1)) vs toPromise

Recently I've been moved to a new project which uses angular 6 as frontend framework and spring for REST services. The project is in development for 2 years now and what I've observed was that almost ...
George Tarida's user avatar
1 vote
0 answers
46 views

selenium. call function result missing 'value' [duplicate]

I want to input login, password and press to login button on site. But python get error. from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support....
Xcode beginner's user avatar
0 votes
2 answers
837 views

Suitescript, How to use query.Operator.ON to get record has exact day from database?

I'm trying to get records has a birthday in [day] by using query ('N/query'). And I'm looking for using the operator "Operator.ON". However, I always get the empty list from DB. When I change from "...
Trung Bùi's user avatar
-1 votes
1 answer
46 views

Why am I not able to use promise in my basic react app?

I am fairly new to react and I was experimenting on axios get requests . So What I am trying to do is that I have a json file in my public folder and I am making a get axios request to the location of ...
Ashutosh Kumar's user avatar
0 votes
3 answers
145 views

How to populate dynamically added input fields with Json object

I have a this table of input fields which I can add rows dynamically with help of KnockoutJS <table id="sTypeTable" class="table table-bordered" hidden="hidden"> <tr> ...
Shukurkhon's user avatar
0 votes
0 answers
37 views

bootstrap.min.js create problem for opening model popup in second time

I am trying to solve the proble and using 2 javascript but there are problem one time popup proper work but second time it is not open [FNP Gardens][1] <script src="http://localhost/fnpmobile2/wp-...
Abhishek Prakash Shukla's user avatar
0 votes
0 answers
928 views

how to integrate "Search Nominatim control " library and openlayers "measure" example for geocoding and measure area simultaneous

I have a code from the openlayers library and example for measuring the length and area on the map.I also have a code from the Nominatim library for "Search Nominatim control" and Geocoding ...
Ali Hosein pour's user avatar
1 vote
0 answers
924 views

Webpack cannot resolve module for custom definition file

I wanted to create d.ts file for my js library. However when I want to import this module into my ts file webpack throws error: ERROR in ./index.ts Module not found: Error: Can't resolve 'TestModule' ...
hetious's user avatar
  • 803
0 votes
2 answers
7k views

ReactJS: How to change Text value on button click

I am creating a form in my App and need to add a quantity field in it. I have added a <Text> component from informed to add quantity field and used buttons to add increment and decrement feature....
Jaimin Sutariya's user avatar
0 votes
0 answers
169 views

onclick on button to add text field not working

I am using the onclick event to add a text field when a button is clicked. It is working for the time div (see image below) but not the pickup div. JS: // time --------------------------- function ...
Grey-lover's user avatar
0 votes
1 answer
2k views

Evaluating JavaScript into WKWebView to fetch the Video URL doesn't work

So I'm trying to get the video source URL by evaluating javascript into WKWebView. Tried to search through many different posts but none of them got me what I want. I'm trying to download videos from ...
Nikhil Viradiya's user avatar
-1 votes
4 answers
83 views

Merging two multidimensional arrays in Javascript by value

I have two arrays: var array1 = [['email1', object1],['email2', object2],['email3', object3],['email4',object4]] var array2 = [['email1',[['a1','b1']]],['email3',[['a3','b3']]], ['email4',[['a4','b4']...
Sam Tyurenkov's user avatar
0 votes
2 answers
75 views

Refreshing a page without constant refreshing [duplicate]

I am currently making a simple clock in and out system for staff. The warehouse has a TV with a list of names on the right of people who have not signed in, and a list of names on the left of those ...
Mike Abineri's user avatar
0 votes
4 answers
6k views

How to set a timeout for a popup?

I created a popup that appears when I click a button, but to make it disappear I have to click again. Is there a way to set a timer and make it disappear? This is the code: // When the user ...
programmer98's user avatar
0 votes
5 answers
69 views

How to send the element object as parameter to javascript function without ID

In function ClickedRow, i want to use the "a" which is being clicked. So i want to receive it as a parameter. <td ...... > <span class="......> <span onmousedown="event.cancelBubble =...
Matt's user avatar
  • 11
0 votes
1 answer
49 views

How to send or passing state from siblings to siblings in react native?

I create an Boilerplate in react native. when i have parent and have to childs components and I want pasing state from child 1 to child 2 I've try send to parent then children2 but not working This ...
zidniryi's user avatar
  • 1,265
1 vote
0 answers
411 views

error code not available in axios response (react frontend) when 503 service maintenance

When maintenance mode of heroku turned on, it creates a 503 error in the frontend. The problem is there aren't any distinguishable property in the error response which only says Error: Network Error ...
Naim Mustafa's user avatar
-1 votes
2 answers
116 views

How to write out n*n Matrix values in JavaScript?

I'm new to JavaScript, so I decided to try to make a simple n*n Array. When I'm trying to write it out, I get, something starnge back. var map = [ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 2, ...
Patrik Vörös's user avatar
2 votes
0 answers
431 views

Making server-side rendered content interactive on the client (SSR + Client-Side JS)

I am currently experimenting with a few thoughts and concepts regarding the utilization of server side rendering (SSR). So far, I have set out to use NestJS, since it lets me use the MVC pattern that ...
Ingwie Phoenix's user avatar
2 votes
1 answer
2k views

Can't find application.js with javascript_pack_tag(Webpacker)

I have installed Webpacker gem in my Rails app and don't really know how to include app.js file into app/javascript/packs folder. I put <%= javascript_pack_tag 'application' %> into my ...
goldie's user avatar
  • 77
0 votes
1 answer
54 views

How to get the result of a js function called with <script>?

I am currently working on a quizz page with code people have already done before. I have to add a timer and when the timer is done, I have to send a form. I have decided to make my function a boolean ...
Thouga's user avatar
  • 1
0 votes
1 answer
65 views

how to avoid the explicit-construction anti-pattern and still keep indentation/callbacks low

Lets say we have a function, that calls a fair amount of async functions like so: downloadAndAssemble = () => new Promise(async (resolve, reject) => { if (!(await ...
David Schumann's user avatar
2 votes
1 answer
386 views

Hide names in Highcharts Venn Diagram

I'm drawing a Venn diagram using Highcharts and only want to show the names of the three main circles, not the intersections, i.e. just show reading, writing and maths. I've tried setting 'name' to ...
Essex Steph's user avatar
0 votes
2 answers
65 views

JSX adjacent on react.js

the code below is divided into two parts one deals with the management of the head the other "body" when I execute the code the exception below is raised, how can I solve the error? I can't figure ...
riki's user avatar
  • 1,645
0 votes
1 answer
14 views

JavaScript: The function listener called by this event listener is not as expected [duplicate]

Although it is somewhat simplistic, when you execute the following code, this points to the document and you can not get an instance of Hoge. If you make variables and functions global, there is no ...
salud's user avatar
  • 103
0 votes
1 answer
126 views

How to show the set of remaining items in array when next button is clicked?

I have 12 cameras in total, when i select 4 cameras option from a drop down box it show only 4 cameras. Now when i click on the next button i need to display the remaining cameras in the selected ...
Niranjana S's user avatar
1 vote
4 answers
249 views

Iterate over an Array and push elements to an Object

I have an array object which looks like this identificationType: "DL", identificationDesc: "Test", referenceNumber: "123456789", country: "US", province: "Illinois" I want my data model to look like ...
Cpt Kitkat's user avatar
  • 1,402
0 votes
2 answers
54 views

Run a block of Script after every img element on page

I run a WordPress blog. I want that for every <img /> tag on a single post page, I will have a script placed directly after it as though I was using the ::after in CSS. I know for CSS I could ...
Kojo Amakye's user avatar
0 votes
1 answer
292 views

How to pass `execCommand(“insertorderedlist”)` the type param

I want to insert Ordered List in the text area. I need the orderedlist to be with type hebrew, it creates the Ordered List but it does not apply any class nor Id so I can't use style="list-style-type:...
user2290492's user avatar
0 votes
2 answers
7k views

Background Color of Material UI Snackbar not being overridden

I'm doing an ErrorHandler in React.JS that pops up a Material UI Snackbar whenever there is an error caught by the ErrorHandler. The problem is that I want the backgroundColor style attribute red, but ...
minus.273's user avatar
  • 765
0 votes
0 answers
104 views

How to send data from HTML to .MDF file, retrieve data from .MDF to .EXE, and return result from .EXE to HTML?

How can I send a group of data from HTML to .MDF file which located in the same folder? There is an .EXE (written in C#) file to process the data. After data processing done, how to notify and ...
William Ong's user avatar
1 vote
1 answer
209 views

not able to fetch text data from web url using javascript

I need to extract text data from web url (http://www.africau.edu/images/default/sample.pdf) I used two node_module. 1) crawler-Request it('Read Pdf Data using crawler',function(){ const ...
dhru soni's user avatar
2 votes
1 answer
283 views

Changing div content when clicking buttons

I'm trying to make some sort of gallery on my website. There are 3 buttons, and underneath some text and picture are placed. When I click the button, I want that the content changes (to the content ...
miron's user avatar
  • 23
1 vote
1 answer
597 views

How to place a div under a textarea and be able to handle events on it?

I want to make something like Grammarly, exactly like this: The text is in a textarea, and a div for highlighting is under it, when I click on the red line, the correction card appears, but with z-...
FrankenStein's user avatar
0 votes
1 answer
709 views

Table header disappears when searching through the HTML table with Javascript function

I've run into some trouble regarding a search function within a php script. The search function is written in javascript and is supposed to loop through the entire table below and pick out the ...
Closing cases's user avatar
0 votes
1 answer
377 views

ml5 (ml5.js): How do I add my own data to the KNN classifier?

Trying to use the ml5 (ml5js.org) KNN classifier on a game I made. But I don't understand how to add my own data to it. <!DOCTYPE html> <html> <head> <title>...
bogus's user avatar
  • 13
1 vote
3 answers
712 views

How to know which params is missing in a query?

I'm setting up a Booking router in NodeJS, and I have many params in. Now when I forgot params I return an error like : 500: Need more information I wonder if it's possible to know which params are ...
Eythan Fellous's user avatar
-2 votes
3 answers
134 views

access DOM and change element font and colour

I want to access some character from string and change the style of them for example "hello" i want to change "h" character's color and font how can i do this i try this var txt=document....
Masoud Niki's user avatar